sindresorhus / modern-normalize

🐒 Normalize browsers' default style

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix the browsers!

sindresorhus opened this issue · comments

The goal of this project is to make itself obsolete. We should try to get browsers to fix their own styles so we don't have to work around them indefinitely.

If you want to help out:

  • Pick a style in modern-normalize.css
  • Go to the relevant browser issue trackers (Chrome, Firefox, Safari), search for an existing issue, and if none, report it (Ensure you follow the guidelines for reporting).
  • Comment here with a link to the issue so we can track it, even if it's an existing issue.
commented

If you open an issue against a browser vendor it helps if you can show that a certain style is already in use by other browsers. The most persuasive argument to change something as core as the default styling is usually if several other browsers already do it as well.

The HTML Standard maintains a section on styles that browsers are expected include by default. This is not always the case in reality yet, but if one or more browser vendors shows interest in aligning around a specific style you could file an issue in the HTML issue tracker to see if the remaining ones are willing to change as well.

While I really like this sentiment of fixing browsers and making the project obsolete in the process, it has to be said that none of the opinionated rules have much chance of being adopted by any browser as long as there's an interest in staying compatible with older content on the web. The rules which resolve differences between different browsers stand a good chance of being fixed though.

What if we could persuade browser makers to support a built-in global normalization? I don't know what form that would ideally take, but for sake of having something concrete to discuss (not necessarily the perfect solution), maybe something remotely like this:

*, ::before, ::after {
  global: normalize;
}

This would allow ancient unstyled content to still party like it's 1993 while everyone else can start styling from a blank slate without having to import a long list of reset rules. It could even be combined with @supports to allow importing modern-normalize only for browsers that don't support the global normalize syntax.

*, ::before, ::after {
  @supports (global: normalize);
  @supports not (global) {
    @import 'node_modules/modern-normalize/modern-normalize.css';
  }
}

Of course if all the browser makers agreed tomorrow to just build in the normalization, I wouldn't care much about the effect on ancient unstyled resources (and I imagine most others here wouldn't either) and would just gladly accept the outcome. This idea is not meant to be proposed as vastly better than the simpler approach of global normalization by default. But if any of the resistance of browser makers relates to the effect on ancient unstyled content, then this could be a solution.

The goal of this project is to make itself obsolete.

I don't believe that will ever happen. It's more than just default styles as well. There are also differences in the styling engines. This issue is a perfect example of that.