Skip to content

Instantly share code, notes, and snippets.

@kaesetoast
Created June 26, 2019 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaesetoast/be2bba45283e3d5c73608d2fb7db1e89 to your computer and use it in GitHub Desktop.
Save kaesetoast/be2bba45283e3d5c73608d2fb7db1e89 to your computer and use it in GitHub Desktop.

CSS Custom Properties are Variables. Just cooler.

If you are using some kind of Preprocessors like Sass, Less, or Stylus, you probably are familiar with the concept of variables in CSS. So now we have the same thing in the Browser – right? Well. Kinda. But better.

Let's explore what makes custom properties different from variables and why they are so much more powerful. Together, we will dive into some real-world examples to see how custom properties can help with some of the challenges of responsive design, theming and a component-driven CSS-architecture.

Custom Properties are well supported among modern browsers and you can use them today! Internet Explorer is still relevant to your customers? – Worry not! We will also take a look at possible fallback strategies for serving legacy browsers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment