Dynamic functions + Media Queries #391
-
Hello and first of all thanks for the great library!:) I have a question regarding complex styling where I need to combine several styling props together and also change their look starting from specific breakpoint. From what I can see in the docs right now you can either have media queries support (via "mq" import and further usage in the stylesheet object) or complex combination of several styling props using dynamic functions (and multiple if statements inside). So the question is how to get the best of both worlds and apply media queries (let's say "starting from lg") to specific combination of styling props? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Breakpoints are designed for that case: https://www.unistyl.es/v3/references/breakpoints eg.: {
container: {
alignItems: {
xs: 'center', // from xs to lg use 'center'
lg: 'flex-end' // from lg and above use 'flex-end'
}
}
} Edit: I would avoid I hope it answers your question 😄 |
Beta Was this translation helpful? Give feedback.
-
I would love to avoid them too, but this is how your v2 documentation proposes to achieve compound variants;) https://v2.unistyl.es/reference/compound-variants/ |
Beta Was this translation helpful? Give feedback.
We're doing what we can to ship it. Should be available somewhere in Q1 of 2025.