Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- Introducing "CSS Custom Properties for Cascading Variables" 2:24
- Declaring and Using CSS Variables 9:46
- CSS Variables vs. Preprocessor Variables 5:28
- Cascade and Inheritance with CSS Variables 5:30
- Providing Fallbacks and Building Length Values 3:00
- Using CSS Variables with SVG 3:33
- Updating CSS Variables with JavaScript 6:41
- Best Practices and Tips 1:02

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
var()
accepts an optional second argument that acts as a fallback value. In the case where a custom property isn't declared anywhere, or if the referenced custom property is invalid, the second argument is used as a substitution value for that property. You can also do simple calculations using CSS variables and calc()
.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up