Why using "css" and not "style" for react components props (and is there a way to change that ?) #1152
-
/** Returns a function that applies styles and variants for a specific class. */
export declare const css: Stitches['css'] Hi Stitches team, why are you using the "css" string to provide css styles to a stitches components, instead of using the string "style" ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
They do different things and both have valid use-cases When you set |
Beta Was this translation helpful? Give feedback.
Sure, there's 3 things at play here in this case. I've not used stitches with tailwind, but usually it goes like this:
Your button:
Variants
This will create a few classes that are put into the head (trivialized here) so that if you switch variants at runtime you're just adding / removing class names which is pretty good for performance.
CSS Prop
But what if you really need a different appearance for …