Closed nuxodin closed 3 years ago
Thanks for the input @nuxodin. I personally don't feel strongly either way, but based my opinions on the argument laid out in CSS Tricks https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/.
I can see both ways being valid and either way, if you need things the other way around, you're going to need to overwrite things. I like the inherit approach because I think it's more common to expect all descendants to behave the same as a parent. With that said, though, I can't say I've ever had to set something to a different box-sizing.
I hope that clears up the thought behind this approach. Any thoughts in response?
This approach also has its value.
Since there are cases where you explicitly want
box-sizing: content-box
, I would rather choose the following:https://github.com/AustinGil/bedrocss/blob/0cbc6dac993e9d1ee099185f956dabaaa2da1cd2/src/base.css#L14
Use case:
Here my
.main-width
Element should always be 40rem, regardless of its padding.