@zanfa97
Posted
Great job, you can use [Custom properties] (https://css-tricks.com/a-complete-guide-to-custom-properties/) to store colors in variables in order to reuse them without rewriting them every time.
Marked as helpful
@A-noob-in-Coding
Posted
@zanfa97 To add up, the syntax of using custom properties or variables in common languages in CSS is:
--YourVariableName : ItsValue
The variables are assigned in root scope of css that is:
:root
{
all variables goes in here
}
For example, lets suppose you want to store a color which is provided as a hsl or rgb value, in a variable because it is a such a hassle to write the color codes for the color over and over again, then it could look like this:
--GrayColor : rgb(128,128,128);
Now you can use this gray color as:
color : var(--GrayColor);
Marked as helpful