Open/close paradigm in Stitches (React) #1128
-
I have a modal that opens/closes according to a boolean value. In styled components I would just pass in a prop called something like There's also the sucky CSS way to do it which is to dynamically add and remove a class, which is what currently exists and which I am trying to convert to Stitches. Stitches is dynamic enough that I could still use this method to toggle the modal, but it's not very clean. I was wondering what the Stitches way to handle this situation would be? 🙏🙏🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Boolean variant can't help you? `const Button = styled('button', { variants: { () => Button;` |
Beta Was this translation helpful? Give feedback.
Boolean variant can't help you?
`const Button = styled('button', {
// base styles
variants: {
outlined: {
true: {
borderColor: 'lightgray',
},
},
},
});
() => Button;`