Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Size variation priority #25

Open
AmirHosseinKarimi opened this issue Mar 12, 2021 · 6 comments
Open

Size variation priority #25

AmirHosseinKarimi opened this issue Mar 12, 2021 · 6 comments

Comments

@AmirHosseinKarimi
Copy link

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

@20lives
Copy link
Owner

20lives commented Mar 12, 2021

Nice catch.
I Will try to think of a solution

@20lives
Copy link
Owner

20lives commented Mar 12, 2021

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' },

@AmirHosseinKarimi
Copy link
Author

@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?

@20lives
Copy link
Owner

20lives commented Mar 13, 2021

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

@AmirHosseinKarimi
Copy link
Author

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

@20lives
Copy link
Owner

20lives commented Mar 13, 2021

I am not planning on leaving it that way :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants