Slide 1
CSS Custom Properties (variables)
Joan Boone
jpboone@email.unc.edu
CSS Custom Properties (variables) Joan Boone jpboone@email.unc.edu - - PowerPoint PPT Presentation
INLS 572 Web Development CSS Custom Properties (variables) Joan Boone jpboone@email.unc.edu Slide 1 When CSS Custom Properties can be useful Purple, gold, red, dark teal, and green are used throughout the Weaver Street Market website
Slide 1
Joan Boone
jpboone@email.unc.edu
Slide 2
have lengthy style sheets with many duplicate values
scheme may reuse three
the site
be difficult and error- prone since it is scattered throughout the style sheet(s).
Purple, gold, red, dark teal, and green are used throughout the Weaver Street Market website
Slide 3
CSS variables can be used to define a specific value that can then be reused throughout your web page Syntax
References
NOTE: CSS Variables are not well-supported by CSS Validation Service
Slide 4
nc-national-parks-CSS-variables.html
:root {
} background-color: var(--main-bg-color); color: var(--heading-color); color: var(--text-color);
Define variables Use the variables
Click here to view in CodePen
Slide 5
With CSS Custom Properties