Overview - CSS custom properties (variables)
What is it?
CSS custom properties, also called CSS variables, let you store values like colors or sizes in a name you create. You can reuse these names throughout your styles, making it easy to change many places by updating just one value. They work like placeholders that CSS understands and replaces when rendering the page. This helps keep your styles organized and consistent.
Why it matters
Without CSS custom properties, changing a color or size used in many places means hunting down every spot and updating it manually, which is slow and error-prone. Custom properties let you update a value once and see the change everywhere instantly. This saves time, reduces mistakes, and makes your website easier to maintain and update.
Where it fits
Before learning CSS custom properties, you should know basic CSS syntax and selectors. After mastering them, you can explore advanced CSS features like calc(), media queries with variables, and CSS preprocessors. In Svelte, understanding how to combine CSS variables with component styles and reactive values comes next.