Replies: 2 comments 2 replies
-
Similar to above, is there any way to directly access props passed in stitches components (like styled-components). Writing every use case for a dynamic process seems tedious and manual. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Actual problem. |
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
-
Hey there!
Loving Stitches so far. There's just one limitation of variants (vs. prop interpolation) that I'm running into and wondering if there's a way around it. Either something I've somehow missed in the library or something that could be changed?
Let's say I need to pass to my CSS a dynamic variable. Or similarly, if I need 10+ variants of a component and writing a variant for each seems tedious, i.e:
I could obviously pass my data as local CSS variables and access them with
var()
:But that's not very readable (and requires some casting in TypeScript - see here).
I noticed that Linaria offers dynamic prop-based styles by compiling the variables into CSS vars under the hood.
Is this something that could be built into Stitches somehow? Or is there another solution I'm missing?
If it's the former, I'd be happy to take a stab at it if someone can give me some initial pointers.
Beta Was this translation helpful? Give feedback.
All reactions