Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

divide-y-0/divide-x-0 classes output faulty values #156

Closed
f-elix opened this issue Mar 26, 2021 · 2 comments · Fixed by #157
Closed

divide-y-0/divide-x-0 classes output faulty values #156

f-elix opened this issue Mar 26, 2021 · 2 comments · Fixed by #157

Comments

@f-elix
Copy link

f-elix commented Mar 26, 2021

What version of @tailwindcss/jit are you using?

0.1.7

What version of Node.js are you using?

14.15.5 (LTS)

What browser are you using?

Chrome

What operating system are you using?

Windows 10

Reproduction repository

Unfortunately this is a private repo that I can't share, but it should be fairly easy to reproduce anywhere.

The divide-y-0 and divide-x-0 classes generate faulty values that have weird side effects when using @tailwind/jit.

With the regular Tailwindcss processor:

.xs\:divide-y-0>:not([hidden])~:not([hidden]) {
    --tw-divide-y-reverse: 0;
    border-top-width: calc(0px*calc(1 - var(--tw-divide-y-reverse)));
    border-bottom-width: calc(0px*var(--tw-divide-y-reverse));
}

With @tailwind/jit:

.xs\:divide-y-0 > :not([hidden]) ~ :not([hidden]) {
    --tw-divide-y-reverse: 0;
    border-top-width: calc(0 * calc(1 - var(--tw-divide-y-reverse)));
    border-bottom-width: calc(0 * var(--tw-divide-y-reverse));
}

The difference is the missing "px" in the @tailwind/jit version, which causes the value to be invalid.

In some cases, these faulty values were causing the element to have 3px borders (top and bottom with the divide-y-0 class).

@adamwathan
Copy link
Member

Fixed in v0.1.10, thanks!

@f-elix
Copy link
Author

f-elix commented Mar 26, 2021

That was almost as fast as your jit compiler. Well done!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants