Jens Oliver Meiert

The Anti-Reset

Post from August 17, 2020 (↻ May 27, 2021), filed under .

I advise against resets. You don’t need them. (We don’t need them.) I think they’re dying. (The reset detection extension barely registers anymore, though that also has other reasons.)

I advise against resets even though, vanity note, I’ve been one of the ones to come up with and promote them. That was in 2004, but I’ve never gone beyond that “universal reset.”

What’s the opposite of that universal reset? Of all resets? The anti-reset. You can write it yourself. It looks something like this, with force but not without flaws (I was impatient and am not sure I included just the needed pseudo-classes, and then there’s incomplete support at least for revert):

*,
::after,
::before,
::first-letter,
::first-line,
::selection,
:active,
:checked,
:disabled,
:enabled,
:focus,
:hover,
:indeterminate,
:target,
:visited {
  all: revert !important;
}

Here’s the gist. Here’s the bookmarklet. Here’s a test page. Firefox, yes, may offer best support. Chrome does not.

I advise against anti-resets 😊 That makes no sense now. But the reset of a reset is not no reset. It’s two resets. But that’s not the same as 0 × 0, it’s more like 1 + 1, when really you want 0, because you already have 1 (style sheet), and no more, old school, and so you don’t want 1 + 1 + 1 but 1 + 0, or 1 + 0 + 0, and that is just getting a bit very complicated now.

I advise against resets. I advise against anti-resets. You don’t need them. (Unless you do. Do whatever you deem appropriate.) See you around.

Tweet this? (If it changed your life, you delight me with a coffee.)

About Me

Jens Oliver Meiert, on April 29, 2020.

I’m Jens Oliver Meiert, and I’m an engineering manager and author. I’ve worked as a technical lead for Google, I’m close to the W3C and the WHATWG, and I write and review books for O’Reilly. Other than that, I love trying things, sometimes including philosophy, art, and adventure. Here on meiert.com I share some of my views and experiences.

If you have questions or suggestions about what I write, please leave a comment (if available) or a message.

Read More

Have a look at the most popular posts, possibly including:

Looking for a way to comment? Comments have been disabled, unfortunately.

Cover: The Web Development Glossary.

Perhaps my most comprehensive book: The Web Development Glossary (2020). With explanations and definitions for literally thousands of terms from Web Development and related fields, building on Wikipedia as well as the MDN Web Docs. Available at Apple Books, Kobo, Google Play Books, and Leanpub.

Stay up-to-date? Follow me by feed or on Twitter.

Found a mistake? Email me, jens@meiert.com.

You are here: HomeArchive2020 → The Anti-Reset

Last update: May 27, 2021

Professional frontend developers produce valid HTML and CSS.