What does revert do in CSS?

and how is it different from unset or initial?

I’ve often used initial and unset in my CSS – global keywords that can be applied to any property. The difference is small, but important: unset allows inheritance, while initial does not. But then Firefox implemented revert and I was confused – how is this one different from the others?!

View on Mozilla Developer »
Revert takes user and user-agent styles into consideration

It turns out revert is the one I wanted all along. It rolls back styles to the expected browser default for each element, rather than using the specification default for each property.

mozilla developer’ orgs

6 ‘mozilla developer’ episodes

2019

Inner & Outer Values of the Display Property @ Mozilla Developer [video]

The display property has been in CSS from the beginning, handling everything from block and inline boxes to list-items and full layout systems like flexbox or grid. Now the display syntax is getting an upgrade to match it’s multiple uses.

Why isn’t this CSS doing anything? @ Mozilla Developer [video]

There are a number of property & value combinations that can lead to CSS being inactive, and now Firefox will tell you why. Open the developer tools, and look for the greyed-out property with an info-box on hover.

Faster Layouts with CSS Grid @ Mozilla Developer [video]

CSS Grid has been available in most major browsers since early 2017, and it makes web layout more powerful than ever before. But complex-looking new syntax (line-names! grid-areas! minmax! fit-content! fr units!) and missing IE11 support can make it scary to many developers.

Why is CSS so Weird? @ Mozilla Developer [video]

CSS is the design language of the web – one of three core web languages – but it also seems to be the most contentious and often perplexing. It’s too easy and too hard, too fragile and too resilient. Love it or hate it, CSS is weird: not quite markup, not quite programming in the imperative sense, and nothing like the design programs we use for print. How did we get here?

Videos, Articles, & Tools @ Mozilla Developer [video]

Over the summer, I’ve been working with Mozilla to help create a new resource for web professionals – with a mix of videos, articles, demos, and open source tools. Today, we’re excited to launch the video channel!