/
CSS supports variables
CSS supports variables
These are pretty handy when it comes to making it possible to define consistent colors across a product or website.
A variable has -- in front of it and then the variable can be used elsewhere. It makes sense combine this with use of named prefixes. To allows these variables to be used everywhere one needs to define them in the :root pseudo selector, i.e.:
:root{
--HEADblue : #00A000;
};
/* Now we can use this everywhere */
.NAVicon{
background-color: var(--HEADblue);
};
See:
Using CSS custom properties (variables) - CSS: Cascading Style Sheets | MDN
, multiple selections available,
Related content
CSS Colors
CSS Colors
More like this
CSS Order Dependent Selectors
CSS Order Dependent Selectors
Read with this
Problems that CSS preprocessors tried to solve that can be done using plain CSS
Problems that CSS preprocessors tried to solve that can be done using plain CSS
More like this
How do we go about overall page layout with a CSS grid?
How do we go about overall page layout with a CSS grid?
Read with this
CSS Selectors
CSS Selectors
More like this
How SASS CSS preprocessors can make for complex CSS
How SASS CSS preprocessors can make for complex CSS
Read with this