DEV Community

Discussion on: How do you reset CSS properties?

Collapse
 
dzhavat profile image
Dzhavat Ushev

Using :not() is a nice approach but isn’t it hard to keep track of with many properties?

Sometimes the reset is not based on just a state but on a nesting position or one sub-property out of many (e.g. background-color when it was previously set using background). I imagine this will result in a complicated :not() selector where a simple 0, transparent or initial will do the same this with less code.

unset is nice too but behaves differently whether the property inherits from its parent or not. Or maybe I find it confusing because I’m not used to it.

Do you think an extension that shows you the default value for a selected property will provide you some benefit?

Collapse
 
nicolalc profile image
Nicola

I think in css :not could be a mess. But with precompiled stylesheets (SCSS, LESS) it could be very useful. Anyway there isn't a global solution, you need to find the best one according to your needs.

Do you think an extension that shows you the default value for a selected property will provide you some benefit?

Yes of course, sometimes it's hard to check what property an object inherit from a super class or id, expecially when they are inherited from third-part components.

I think a plugin wich displays a graph with inheritances is needed!