// origin$best-color: hsl(322, 92%, 24%);// meaning$action: $best-color;// usage$link: $action;$button: $action;
$colors: ( 'brand-blue': hsl(195, 52%, 31%), 'brand-orange': hsl(24, 100%, 62%), 'brand-pink': hsl(322, 92%, 24%),);html { @for $name, $value in $colors { --#{$name}: #{$value}; }}
Browser Fallbacks html { background: red; }@supports (--css: variables) { html { background: green; }}
[attr] ➡ Presence (even if empty) [attr="..."] ➡ Exact match [attr*="..."] ➡ Any match [attr~="..."] ➡ Space-delimited (like classes) [attr|="..."] ➡ Hyphen-delimited [attr^="..."] ➡ Starts with… [attr$="..."] ➡ Ends with… [attr="..." i|s] ➡ Case sensativity
html { @media (prefers-color-scheme: dark) { --os-mode: -1; } @media (prefers-color-scheme: light) { --os-mode: 1; }}
Our medium is not done. Our medium is still going through radical changes. – Jen Simmons, Designing with Grid