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?
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!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
If you want to reset and delete a property try to use unset.
Else if you want the property to be handled from a parent instance, or another css rule use inherit.
But in your case I use usually the :not selector excluding some properties in a specific or a set of states:
I prefer this solution because is more clean and more readable. What do you think about this?
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 usingbackground
). I imagine this will result in a complicated:not()
selector where a simple0
,transparent
orinitial
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?
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!