Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Best Practices and Tips1:02 with Guil Hernandez
Now that you've learned how and where custom properties and
var() work, you should know where they do not work, and best practices for using them.
[SOUND] Now that you've seen how and
where custom properties in the var function work,
you should know where they do not work and a few best practices for using them.
[SOUND] First, var is invalid if used in a selector.
This will not work.
[SOUND] var is also not valid as a property name,
you can only use var in CSS values.
You also can't use var in a media query expression like this.
[SOUND] Finally, you can't use the var function to create a length value.
This is an invalid value.
[SOUND] Again, be sure to use calc to build your length values using var
as you learned in an earlier video.
Finally, variable names are case sensitive.
So for example, each of these three variables represent a different variable.
As you'll learned in this workshop, CSS variables are a useful and fun feature.
So i suggest that you experiment with them and begin using them in your projects.
Thanks everyone, and happy coding.
You need to sign up for Treehouse in order to download course files.Sign up