20lives/tailwindcss-rtl

:not([dir="rtl"]) is breaking everything

Closed this issue · 6 comments

cdes commented

the change you did in the 0.8.0 is not working as you would expect. You can see a screen shot here where :not([dir="rtl"]) and [dir="rtl"] are both valid.

Although [dir="rtl"] matches the tag selector, :not([dir="rtl"]) will match the selector.

Screen Shot 2022-01-02 at 5 50 04 PM

I think the issue is that the rule :not([dir="rtl"]) is for the current element (regardless of the parent) so I think it would be better if we assigned specified it to the body body:not([dir="rtl"])

I created a PR #45 to fix this issue. It will depend on the body direction.
Check it out and let me know what you think.

@20lives merge please

maybe it's better to revert to dir="ltr" and just require either ltr or rtl on the top level layout element of your choosing, since #45 locks it to the body element, which may go against some people their use case.

e.g. @cdes in his screenshot uses the html element. Others may place the dir attribute further down the tree.

Hi everyone!
Sorry for my unavailability, was occupied with other things.

The last change did break a lot of stuff and I am sorry for that as well.

I think that reverting to the last version is the best decision (and "forcing" you to have dir="ltr/rtl" at the top level) is our best choice.

this will be done today, including a new release.

if you think that the other solution that came up is better, let's talk about it.

Finally fixed, use version 0.9.0.