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

Allow for using x-show with an important modifier #3002

Merged
merged 2 commits into from Jul 11, 2022

Conversation

timkley
Copy link
Contributor

@timkley timkley commented Jun 23, 2022

Following up on this discussion.

There are cases where someone may use a class which itself sets the display property. If it is set with the !important property x-show stops working as expected because the class will always take precedence.

This PR adds an .important modifier to x-show which sets the inline style with !important itself.

I've added a test and updated the docs, please let me know if there are other changes needed :)

This sets the display property with the important property.
This is useful for overriding classes which itself set the display
property with !important
Co-authored-by: Ryan Chandler <ryangjchandler@gmail.com>
@calebporzio
Copy link
Collaborator

This is great, thank you!

@calebporzio calebporzio merged commit 4654eb0 into alpinejs:main Jul 11, 2022
@timkley timkley deleted the x-show-important branch July 11, 2022 16:48
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

Successfully merging this pull request may close these issues.

None yet

3 participants