Changing css classes based on screen size #4340
Unanswered
grobiwebdesign
asked this question in
1. Help
Replies: 2 comments
-
You should just use CSS for this. https://developer.mozilla.org/en-US/docs/Glossary/Media_query Baring some particularly wild situations, this should always be css. But if you must, you can use But you should do this in CSS, not in JS. |
Beta Was this translation helpful? Give feedback.
0 replies
-
A little tip: AlpineJS now has Resize Plugin |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm looking to tidy a CTA section (made in bulma css) by having Alpine.JS change the class names depending on screen size. I would like the text and button to center-align themselves on mobile screens.
What I've got is this, and I need help:
Beta Was this translation helpful? Give feedback.
All reactions