Don't use all:unset for CSS reset

| permalink | css

I thought I'd try my hand at using all:unset for CSS reset.

Turns out it's more trouble than its worth.

The reason is that browsers all have their own vendor-specific properties to achieve baseline behavior, and by unsetting everything you break basic functionalities.

For example, all:unset on the html element in Chrome will break hyphenation, which can only be restored via -webkit-locale: 'en'.

In addition, you will have to steer clear of <svg>, <audio> and <video> elements etc.

The conclusion is - the vendor stylesheet does many many things to achieve that "unstyled" look, and unsetting all of them cause you more headaches than it solves.