CSS Custom Properties, Media Queries, And Responsive Design

One thing you can do with CSS custom properties that you can’t do with variables in preprocessors is redefine them and assign new values inside @media queries. It’s a useful ability to have and one more reason why you’d want to work with what are effectively native CSS variables.

Continue reading

How To Use CSS Custom Properties To Write More Readable Code

Before being interrupted by the birthday of the United States, I was talking about CSS custom properties, which if you remember, allow you to create variables directly in CSS instead of having to use preprocessors.

Continue reading

How To Define And Use CSS Custom Properties

A few years ago I offered a quick look at CSS custom properties, which provide a way to define and use variables directly in CSS. At the time the only browser with support was the nightly build of Firefox. Given the lack of support and that we could already use preprocessors like Sass to write variables, I promptly forgot all about custom properties after writing the post.

Continue reading

How To Use Sass Variables

Think of all the times you might add the same color to different elements or classes in your CSS file and then think of all the fun you have changing everything when you decide another color would work better. Wouldn’t you prefer to make the change once and have the rest update automatically?

Continue reading

Why Native CSS Variables Will Be A Good Addition

On Monday I walked through css custom properties for cascading variables and mentioned that some people have objections to variables becoming part of the css language. Two notable objectors are Jeremy Keith and Chris Coyier.

Continue reading