Content-type: text/html Downes.ca ~ Stephen's Web ~ What is the difference between CSS variables and preprocessor variables?

Stephen Downes

Knowledge, Learning, Community

The world of web page style has become complicated and complex, partially because of the need to support numerous browsers (both PC based and mobile) and partially because large-scale projects require variables and functions to facilitate management. This article looks at one aspect of that, CSS variables. Of particular value is the discussion of the role of CSS preprocessors like Stylus, Less, and PostCSS. These take youir default values for things like colours and text styles and turn them into standards-compliant CSS code. Of course, you could just use CSS variables to accomplish the same thing without so much work. And you can use Javascript to manipulate these directly. But you begin to run into cross-browser implementation issues.

Today: 4 Total: 1117 [Direct link] [Share]

Image from the website
View full size


Stephen Downes Stephen Downes, Casselman, Canada
stephen@downes.ca

Copyright 2024
Last Updated: Apr 18, 2024 9:37 p.m.

Canadian Flag Creative Commons License.

Force:yes