What is the difference between CSS variables and preprocessor variables?

Chris Coyier, CSS Tricks, Oct 25, 2016
Commentary by Stephen Downes

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.

Views: 1 today, 287 total (since January 1, 2017).[Direct Link]