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
This is unique to pseudo-elements and does not apply to pseudo-classes. Pseudo-classes should remain on the inside of :is(). This already works for most pseudo-elements in TailwindCSS, so maybe it's just keeping an index of all of them. Could TailwindCSS be set up such that any time a double :: appears, it instructs the compiler to display it after the :is()?
I considered maybe it's the case that it keeps them all inside unless on a specific list since some devs write :before vs. ::before, and trying to determine that intelligently for some like that is fine, but could the double ::—when used—be set to always indicate a pseudo-element (vs. a pseudo-class)?
The text was updated successfully, but these errors were encountered:
brandonmcconnell
changed the title
Som arbitrary pseudo-elements are moved inside :is() when using important config option, breaking the selector
Some arbitrary pseudo-elements are moved inside :is() when using important config option, breaking the selector
Jun 1, 2023
Hey! This was an intentional decision originally but it has definitely resulted in a bit too much churn so I've updated the behavior for unknown pseudo-elements.
I've merged in the fix via #11345 and it'll be available when we do our next patch release. In the meantime you can test it using our insiders build:
npm install tailwindcss@insiders
The build will take a few minutes to build, test, and publish but should be out soon.
Reproduction URL
important
(w/o:is()
): https://play.tailwindcss.com/yOqpv2N25Jimportant
(w/:is()
): https://play.tailwindcss.com/gVUTg4DLNKDescribe your issue
This code:
Config
Markup
Generated CSS (invalid)
Instead of including the pseudo-element on the inside of
:is()
, it should remain on the outside, where it is valid.For example, the rendered output of
[&::-moz-progress-bar]:[&:hover]:font-bold
should be…but is currently…
This is unique to pseudo-elements and does not apply to pseudo-classes. Pseudo-classes should remain on the inside of
:is()
. This already works for most pseudo-elements in TailwindCSS, so maybe it's just keeping an index of all of them. Could TailwindCSS be set up such that any time a double::
appears, it instructs the compiler to display it after the:is()
?I considered maybe it's the case that it keeps them all inside unless on a specific list since some devs write
:before
vs.::before
, and trying to determine that intelligently for some like that is fine, but could the double::
—when used—be set to always indicate a pseudo-element (vs. a pseudo-class)?The text was updated successfully, but these errors were encountered: