20lives / tailwindcss-rtl

Enabling bidirectional support on tailwindcss framework
MIT License
351 stars 34 forks source link

Cannot create 1px borders with border-s and border-e #16

Closed mattlangeman closed 3 years ago

mattlangeman commented 3 years ago

First, thanks for this tailwind plugin. I like the approach for making tailwind support right to left languages.

I ran into an issue creating 1px width borders using border-s and border-e.

In tailwind I can use border-l to create a 1px border on the left of a container. Similar with border-r. However, border-s and border-e does not behave this way.

My options are:

20lives commented 3 years ago

this should work, let me check it.

20lives commented 3 years ago

Everything seems to be in place: image

Can you upload a demo or screenshot of the problem?

mattlangeman commented 3 years ago

Interesting. I looked at the generated stylesheet and found the following rules:

.border-s-0 {
  border-inline-start-width: 0px;
}

.border-e-2 {
  border-inline-end-width: 2px;
}

.border-s-2 {
  border-inline-start-width: 2px;
}

.border-e-4 {
  border-inline-end-width: 4px;
}

.border-s-4 {
  border-inline-start-width: 4px;
}

.border-e-8 {
  border-inline-end-width: 8px;
}

.border-s-8 {
  border-inline-start-width: 8px;
}

.border-e-DEFAULT {
  border-inline-end-width: 1px;
}

.border-s-DEFAULT {
  border-inline-start-width: 1px;
}

I'm not sure why I'm seeing -DEFAULT for the 1px width rules.

20lives commented 3 years ago

what versions of tailwindcss and tailwindcss-rtl are you using?

mattlangeman commented 3 years ago

tailwindcss: 2.0.1 tailwindcss-rtl: 0.7.1

I am using django-tailwind but my understanding is that it is essentially a wrapper around the npm stuff.

20lives commented 3 years ago

Found it, this seems to be some incompatibility with v2, I will try to fix this soon. Thanks.

20lives commented 3 years ago

If this is critical you can downgrade to 1.9.6 for now.

mattlangeman commented 3 years ago

Thanks. This is not critical. My new workaround is just using border-s-DEFAULT or border-e-DEFAULT. I see this affects other utilities. In my digging I ran into this merged pull request which I'm guessing you also found.

20lives commented 3 years ago

pretty simple fix, should have done this earlier.

thanks.