2 ms·
I'd love to see it become standard practice to use a system like this to define a set of SASS variables that could then be composed in other rules rather than e
by harimau777 7y ago
I'd love to see it become standard practice to use a system like this to define a set of SASS variables that could then be composed in other rules rather than either hard coding the colors in each rule or using utility classes (e.g. ".blue").
You could probably do the same thing with text styles by defining variables for things like headline font, body font, monospaced font, etc.
- rriepe 7y agoI made something like this in Less, and I don't think Sass can do it.
- afandian 7y agoYou mean like https://www.w3.org/TR/REC-html40/types.html#h-6.5 https://www.w3.org/TR/REC-html40/types.html#h-6.5 ?
- harimau777 7y agoThe difference that I would see is that most designers probably don't want to be restricted to just the colors that are defined in the spec and it would be useful to have the colors associated with their purpose (e.g. text color, background color) so that they could be changed without having to change them throughout the various rules.
- afandian 7y agoYes, sorry, I was being flippant. Giving names to colours in a universal spec like HTML5 would be asking for trouble. You'd be on a never-ending treadmill of new colours. Constants (however that's done, e.g. SASS variables) is clearly the way to go.