Replies: 1 comment
-
Thanks @hmbrg! My two cents is that I'm not sure this is likely to be considered unfortunately because Stitches is intended to be as close as possible to zero runtime (and the team is also considering build time static extraction), but the proposed API looks to be runtime dependent. If you already have a bunch of classes though, I'm not sure why you need stitches at all? Something like this would be less overhead: const variants = {
color: {
undefined: 'foo bar',
violet: 'baz hello',
gray: 'hello',
}
};
const Button = ({ color }) => <button className={variants.color[color]} /> |
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
-
Currently, stitches doesn't allow applying CSS classes using the styles object syntax. CSS classes could then be applied to variants and overwrite base classes. This would also allow integrating CSS frameworks like Tailwind.
The syntax could look something like this:
The keyword
apply
applies any number of CSS classes to the Component. Inside variant properties, we can apply additional classes but also remove applied classes by listing them under theremove
keyword.Is this something that would be considered to be added to Stitches?
If so, I would happily create a PR.
Beta Was this translation helpful? Give feedback.
All reactions