From the course: CSS: Variables and Fluid Layouts
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
CSS custom properties overview - CSS Tutorial
From the course: CSS: Variables and Fluid Layouts
CSS custom properties overview
- [Instructor] Recently available for our use, custom properties are an exciting new development in CSS. A custom property is similar to a variable, which you might've encountered in other programming languages or in Sass. And if you haven't programmed in other languages, well, you've likely encountered our old friend x when you did algebra back in school. X could mean anything you wanted it to mean. Substitute x in a math problem and we know how to use the value of x to get that math problem computed. Custom properties work just like these kinds of variables, but there's a few differences to be aware of. First of all, define a variable within a CSS declaration. In other words, you'll have to declare a selector with values in it in order to declare the variable rather than just saying x equals two. Next, values of variables inherit. If you place a variable value at the top level of a webpage, then all of the webpage can…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
CSS custom properties overview3m 44s
-
(Locked)
Configure CSS custom properties2m 26s
-
(Locked)
CSS custom properties and inheritance4m 27s
-
(Locked)
CSS custom properties and Sass variables3m 37s
-
(Locked)
Using Sass variables3m 25s
-
(Locked)
Challenge: Add custom properties to type scale2m 27s
-
(Locked)
Solution: Add custom properties to type scale2m 20s
-
(Locked)
-
-
-