1
HTML/CSSBeginner#css#selectors
Custom properties, declared with -- prefix, store reusable values accessible via var(), often on :root for global scope. They can be overridden per component/media query and updated dynamically via JavaScript, unlike Sass variables which are compile-time only.
:root { --primary-color: #2563eb; --spacing: 16px; }
.button {
background: var(--primary-color);
padding: var(--spacing);
}
@media (max-width: 600px) { :root { --spacing: 8px; } }