20lives/tailwindcss-rtl

Size variation priority

AmirHosseinKarimi opened this issue · 6 comments

Hi, I have a scenario which I need set text align to start by default and set it to center on SM break-point.
So set these class: text-start sm:text-center
The result is not correct:
Screenshot from 2021-03-12 15-23-50

The text-start will override sm:text-center

Nice catch.
I Will try to think of a solution

Adding the following to textAlignUtilities.js solves this specifically, but this could be pretty expensive when adding to all utilities without directions.

'[dir] .text-center': { 'text-align': 'center' },

@20lives Thanks for quick fix solution, I just handled it by is_rtl() condition for temporary hot fix in this specific scenario.
I just think about it, what about disable Tailwind core text align plugin and extend it via direction prefix to fix rules priority in variations?

I don't think it's possible to remove existing utilities with plugins

But can mention it on documentation which need manually do it to fix the issue?

I am not planning on leaving it that way :)