CSS custom properties and the cascade

p {
background-color: red;
background-color: color(display-p3 1 0 0);
}
:root {
--myvariable: color(display-p3 1 0 0);
}
p {
background-color: red;
background-color: var(--myvariable);
}
background-color: unset;

--

--

--

A web developer and author living and working in Brighton, England. Everything I post on Medium is a copy — the originals are on my own website, adactio.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

A Simple Solution for Zero Downtime on Deployments with Docker

Designing for High-Volume Reads in Salesforce

Installing and Setting up Oh-my-zsh Terminal on Windows

Maximize power of Snowflake Cloud by monitoring key metrics of usage and cost in PowerBI

How we made a prototype Bluetooth mobile app concept in a week with no Swift programming experience

What’s Wrong With Your CRUD APIs- Besides Everything?

Tired of version mismatch errors in package.json ?

MongoDB Tips, Workplace Humor, & More

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jeremy Keith

Jeremy Keith

A web developer and author living and working in Brighton, England. Everything I post on Medium is a copy — the originals are on my own website, adactio.com

More from Medium

Why use Gatsby?

why us gatsby. La Small Agency - Web Agency

How Storybook helps designers & developers stay in sync

Flexibility first: scaling our white-label solution for industry partners