tailwindcss-theme-variants icon indicating copy to clipboard operation
tailwindcss-theme-variants copied to clipboard

[JIT] group variants like group-hover not working

Open Kuirak opened this issue 4 years ago • 2 comments
trafficstars

Hello,

group variants like group-hover or group-focus are generating wrong css with tailwindcss-theme-variants plugin. I don't know if it is a bug in this repo or in tailwindcss JIT bug so I will cross post it

Here is a reproduction repo: https://github.com/Kuirak/jit-tailwindcss-theme-variants/

Expected Output:

:root.dark-theme .dark\:group:hover .dark\:group-hover\:bg-amber-300 {
	--tw-bg-opacity: 1;
	background-color: rgba(252, 211, 77, var(--tw-bg-opacity));
}

Output

:root.dark-theme .dark\:group:hover .group-hover\:bg-teal-300 {
	--tw-bg-opacity: 1;
	background-color: rgba(94, 234, 212, var(--tw-bg-opacity));
}

:root.dark-theme .dark\:group:hover .group-hover\:bg-amber-300 {
	--tw-bg-opacity: 1;
	background-color: rgba(252, 211, 77, var(--tw-bg-opacity));
}

Kuirak avatar Apr 19 '21 08:04 Kuirak

This is within this plugin's realm to fix. That'll be a TODO.

It shouldn't be that hard to solve but might be a breaking change, so I might bundle it up with the other changes I have planned for 2.0.

JNavith avatar Apr 20 '21 01:04 JNavith

Good to hear, do you have a rough ETA of 2.0?

After thinking about it some more I think the expected selector output should be:

:root.dark-theme ~~.dark:~~group:hover .dark\:group-hover\:bg-amber-300

Kuirak avatar Apr 21 '21 09:04 Kuirak