An example
The subheading uses the same custom property for the color
, with a border
selector using the one of the custom properties used above for the color
value of the border
property.
The CSS is shown below:
color
property, in a section using another custom color
property for the background-color
.
The subheading uses the same custom property for the color
, with a border
selector using the one of the custom properties used above for the color
value of the border
property.
The CSS is shown below:
html { --darkGreen: #5c8; --myPink: #fce; --myBorder: 4px solid var(--myPink); --myCodeColor: #88f; } section { color: var(--darkGreen); background: var(--myPink); } article h3 { color: var(--darkGreen); border-bottom: var(--myBorder); } code { color: var(--myCodeColor); }