3 ms·
CSS variables do something fundamentally different than SASS/LESS approaches. Moreover, it is something which those approaches are incapable of doing. Convers
by bkardell 14y ago
CSS variables do something fundamentally different than SASS/LESS approaches. Moreover, it is something which those approaches are incapable of doing. Conversely, SASS and LESS do something that CSS can never do - be processed only once.
Much of the confusion I think is in the fact that we are referring to two dramatically different things by the same word "variables". In CSS terms it is more helpful (IMO) to think of them more like "user defined properties" which work exactly like every other property in CSS.
- thechangelog 14y agoOr call what SASS and LESS do global constants.
- bkardell 14y agoYes, I agree, but too late for that change probably. Plus I'm sure someone will point out that they are not actually necessarily constant by strict definition either. An easier way to think about it is that they are essentially clever compile time template systems which output CSS... It's totally unrelated that their input also happens to look a lot like CSS - it isn't.