From a previous answer: all: initial
isn't supported by Edge (Safari is finally OK)
- So you can reset manually a hundred of properties if you really really really want to be sure (forget the most obscure ones you know you don't use. If you're a third party, well no luck).
- You can (should) add the
!important
modifier (that's one of those cases where it isn't possible to do in some other way... Fine for me at least)
- You can also add a whole lot of specificity to your selectors by adding an id to your component's parent and prefix each of your selectors with that id:
#myComponent.my-component .my-component-descendant { color: #333 !important; }
. If your existing CSS already uses id (meh), you can go even further (lower, quality wise) and use the same id multiple times in a single selector. #myComponent#myComponent#myComponent.my-component .my-component-descendant { color: #333 !important; }
. What is one the crappiest thing you can imagine in a sane project is also a powerful tool when you need to add "enough" specificity.
Food for thought: the modern way of setting box-sizing
by setting it on :root and then letting inheritance do its job can be helpful (or not) https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/
Advantage: if you set another value on a descendant, descendants of the latter will inherit from it. You now have a whole part of your DOM inheriting from another value.