stitchesjs / stitches

[Not Actively Maintained] CSS-in-JS with near-zero runtime, SSR, multi-variant support, and a best-in-class developer experience.
https://stitches.dev
MIT License
7.76k stars 254 forks source link

Add support for stitches css variable fallbacks #971

Open joseDaKing opened 2 years ago

joseDaKing commented 2 years ago

Is your feature request related to a problem? Please describe. Add support for stitches CSS variable fallbacks that should work with theme map

Describe the solution you'd like

css({
  // Stitches css var with default value
  color: "$$color(red)",

  // Stitches css var without default value
  backgroundColor: "$$color"
});

Describe alternatives you've considered I could use raw CSS vars but then it would not work with the theme map.

shhmon commented 1 year ago

Is this something that will be supported? It's a feature I'd really appreciate, especially in combination with locally scoped tokens which might or might not be defined depending on nesting.