-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When upgrading from 3.4.0 -> 3.4.1 data-[] is now less specific than dark:
breaking change
#12764
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
dark:
attribute
Okay I see what happened. So data-[] tags are no longer more specific than the <p data-type={type} class=" data-[type='blue']:text-blue-600 text-black dark:text-white">
This should always be blue when type is blue
</p> It is white in dark mode but blue in light mode. This is a huge breaking change. Maybe instead of a 0.0.x release it should've been marked as a breaking change. It seems like this is intended behavior looking at the original PR and as mentioned it breaks a large amount of existing code. |
dark:
attributedark:
breaking change
I don't understand how this isn't a bigger bump in version. It completely changes the way There's also mention of this in the docs and the new |
It's was breaking change from
|
I guess 3.4.0 has been out longer than I thought. Thanks for clearing this up. Is there a recommended way to use 'dark:' now? For examples like the one I showed should we be duplicating the text-blue-600 as dark:text-blue-600 or something else? |
If you want to keep the <p data-type={type} class=" data-[type='blue']:!text-blue-600 text-black dark:text-white">
This should always be blue when type is blue
</p> |
The suggestion @wongjn gave is exactly what I'd do here. You happened to install Tailwind in the period before we'd fixed the breaking change (sorry about that!). Personally, I'd use Hope that helps and let us know if you've got other questions! |
What version of Tailwind CSS are you using?
3.4.1
What build tool (or framework if it abstracts the build tool) are you using?
vite 5.0.11
svelte 4.2.7
sveltekit 2.3.2
What version of Node.js are you using?
18.16.0
What browser are you using?
Edge
What operating system are you using?
Windows
Reproduction URL
In this case I would have to link to my actual project. When I try to recreate it with a smaller project I can't, maybe to do with the amount of classes in the project.
I totally understand if the issue is closed but I thought I'd try anyways.
If you fork https://github.com/ieedan/geist-ui-svelte
npm install # loads the 3.4.0 version npm run dev
Then navigate to: http://localhost:5173/components/text
Under colors it should look like this
Now if you run
Some of colors applied from the text component by data-[] are not applied.
Here is what that component looks like. There are other components breaking in the same way that have just as many or more classes.
Describe your issue
Upgrading from version 3.4.0 -> 3.4.1 gives me issues with data-[] applying styles. Some still apply but many do not.
The text was updated successfully, but these errors were encountered: