// colors$brand-color: hsl(330, 100%, 45%);$action: $brand-color;// sizes$gutter: 1.5rem;$spacer: $gutter * 3;
html { /* colors */ --brand-color: hsl(330, 100%, 45%); --action: var(--brand-color); /* sizes */ --gutter: 1.5rem; --spacer: calc(var(--gutter) * 3);}
$brand-colors: ( 'brand-blue': hsl(195, 52%, 31%), 'brand-orange': hsl(24, 100%, 62%), 'brand-pink': hsl(330, 100%, 45%),);
❗🖥 User Agent Important ❗👥 User Important ❗🎨 Author Important 🎨 Author Styles 👥 User Preferences 🖥 User Agent Defaults
🎠 Transitions ❗🖥 User Agent Important ❗👥 User Important ❗🎨 Author Important 🏇🏽 Animations 🎨 Author Styles 👥 User Preferences 🖥 User Agent Defaults
[data-theme] { background-color: var(--theme-bg, var(--global-bg)); color: var(--theme-color, var(--global-color));}
[data-theme='light'] { --theme-bg: var(--neutral-light); --theme-color: var(--neutral-dark); --theme-link: var(--primary-dark);}[data-theme='dark'] { --theme-bg: var(--neutral-dark); --theme-color: var(--neutral-light); --theme-link: var(--primary-light);}
html { @media (prefers-color-scheme: dark) { --os-mode: -1; } @media (prefers-color-scheme: light) { --os-mode: 1; }}
<div class="media media_reverse"> <img class="fixedMedia" src="myImg.png" /> <div class="text">...</div></div>
<div class="media media_rounded"> <img class="fixedMedia" src="myImg.png" /> <div class="text">...</div></div>
[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 sensitivity
More Resources CSS Custom Properties In The Cascade, by me Using Custom Property “Stacks” to Tame the Cascade, by me Global and Component Style Settings with CSS Variables, by Sara Soueidan A user’s guide to CSS variables, by Lea Verou