Temp variables #107
-
Sorry if this is a silly question, but I notice in many of the examples a favored approach of using temp variables like: --_link-text: var(--gray-7);
...
& > a {
color: var(--_link-text); This is merely for the ability to better express what the variable represents within the usage correct (as opposed to having to mentally parse |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Lea Verou writes very well about the benefits and reasoning here! https://lea.verou.me/2021/10/custom-properties-with-defaults/ I think of it like, you have global props (generics), which back your app props which aren't specific to a token/prop, they're about a purpose. have a prop back a prop has big benefits. See the Color 101 section for a nice breakdown of when it becomes really nice. like for example, users of your design system dont need to memorize |
Beta Was this translation helpful? Give feedback.
Lea Verou writes very well about the benefits and reasoning here! https://lea.verou.me/2021/10/custom-properties-with-defaults/
I think of it like, you have global props (generics), which back your app props which aren't specific to a token/prop, they're about a purpose. have a prop back a prop has big benefits. See the Color 101 section for a nice breakdown of when it becomes really nice. like for example, users of your design system dont need to memorize
--gray-3
for dark theme light text if you just have a--text-2
var that is being adapted to light and dark in media queries. it's like, there's props that back all the props (back of the front-of-the-front) and then the props the front-…