You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However it seems that it is only dependend on the cascade because the * selector does not add specificity.
I could verify this by pasting the HTML and CSS utilities from this https://play.tailwindcss.com/j6Cr1VWSam to a codepen, then move this class to the top of the CSS file :
.\*\:size-14>*{
width:3.5rem;
height:3.5rem
}
Resolving the childVariant plugin before the utilities would fix this.
One could argue that it is currently nice to be forced to mark the overriden child with important!, to be explicit about the fact that a rule was already defined on the parent.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The documentation states that overriding a style with a utility directly on the child itself won’t work due to the specificity of the generated child selector (https://tailwindcss.com/docs/hover-focus-and-other-states#styling-direct-children).
However it seems that it is only dependend on the cascade because the
*
selector does not add specificity.I could verify this by pasting the HTML and CSS utilities from this https://play.tailwindcss.com/j6Cr1VWSam to a codepen, then move this class to the top of the CSS file :
Resolving the childVariant plugin before the utilities would fix this.
One could argue that it is currently nice to be forced to mark the overriden child with
important!
, to be explicit about the fact that a rule was already defined on the parent.Beta Was this translation helpful? Give feedback.
All reactions