twind icon indicating copy to clipboard operation
twind copied to clipboard

[Bug]: the order of the utilities is incorrect

Open gera2ld opened this issue 2 years ago • 3 comments

Reproduction

https://twind.run/forum-taper-stir

Describe the bug

Open the reproduction link, note that the class top(12 md:0) doesn't work as expected.

md:top-0 should take priority of top-12 but it doesn't.

Severity

serious, but I can work around it

System Info

## Browsers:
 - Chrome: 112.0.5615.121

Additional Information

I have encountered this issue for several times and it's really hard to reproduce. Sometimes it works after I remove or change some of the irrelevant classes. The same happens here, it will work if I remove the injectGlobal.

gera2ld avatar Apr 15 '23 14:04 gera2ld

Had this happening to me as well when i tried to override a color from another class conditionally (input validation), had to end up applying the color as inline style when the state changed. Since your problem is related to media queries, you can't work around it like I could

TheYuriG avatar Jun 10 '23 09:06 TheYuriG

I'm experiencing much the same thing. The class order seems to be dependent on unrelated classes:

// Generated CSS has `.sm\:hidden` before `.flex`
<nav class="group relative flex items-center text-lg sm:hidden">

But adding a seemingly unrelated class to the end flips the order:

// Generated CSS has `.flex` before `.sm\:hidden`
<nav class="group relative flex items-center text-lg sm:hidden bg-red-500">

I've failed to reproduce this in the playground, where the classes are generated in the correct order. It seems to be highly dependent on the classes of other unrelated elements.

Concretely, this occurs in at this line.

Version info

oeb25 avatar Sep 06 '23 09:09 oeb25

I'm experiencing the same problem here, and its order even dependent to the route.

ieiekk avatar Sep 12 '23 08:09 ieiekk

Hey folks. This issue hasn't received any traction for 90 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it.

stale[bot] avatar Jul 09 '24 00:07 stale[bot]