Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Why was the border box rule changed? #193

Closed
mattpilott opened this issue Aug 13, 2019 · 2 comments
Closed

Question: Why was the border box rule changed? #193

mattpilott opened this issue Aug 13, 2019 · 2 comments

Comments

@mattpilott
Copy link

Hey,

I see way back in v6 the border-box rule was changed from inherit from html to being explicitly defined, why was this decision made out of interest?

Thanks

@hacknug
Copy link
Member

hacknug commented Aug 14, 2019

I believe it was because pseudo elements don't inherit the value from their parent: https://github.com/csstools/sanitize.css/blob/master/CHANGELOG.md#600-june-24-2018

EDIT: Here's a comment from @jonathantneal explaining why jensimmons/cssremedy#4 (comment)

@jonathantneal
Copy link
Collaborator

@matt3224, that’s a fair question. I dropped the inheritance strategy for 2 reasons.

  1. The CSSWG has determined that box-sizing should be border-box by default. However, to keep the web backwards compatible, specs and browsers will continue shipping content-box as the default. Therefore, making border-box the default in sanitize.css is more “standards facing” than the inheritance strategy.
  2. The individual “responsible” for the inheritance strategy now agrees with the CSSWG. I know because I am that person.

My motivation for the inheritance strategy was to “make it easier to change the box-sizing in plugins or other components that leverage other behavior.” That was only a good interim strategy while browsers like Internet Explorer 5-6 did not support border-box, and browsers like Firefox 3-22 required a moz prefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants