Add screen breakpoints dynamically #17488
Unanswered
alinaserinet
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I need to add screen breakpoint dynamically, Is there a way?
I store button classNames in an Object with this structure:
actually this is a basic class variants.
Now I need to define responsive class variants, for example I need to define
red
button for mobile size, andgreen
button for desktop size.I pass a prop like:
color: {xs: 'red', lg: 'green'}
into Button component, and need an util to generate responsive classNames.But as you know using tailwind we can't add breakpoints dynamically. I tried to generate a responsive className, and the output string is Okay but styles not applied.
What solution do you suggest to solve this problem?
I can use a tool like CVA for class variations but I need a mechanism for responsive variants.
Beta Was this translation helpful? Give feedback.
All reactions