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

Get Tailwind Arbitrary Value #357

Open
JarolinVargas opened this issue Dec 19, 2023 · 4 comments
Open

Get Tailwind Arbitrary Value #357

JarolinVargas opened this issue Dec 19, 2023 · 4 comments
Labels
context-v2 Related to tailwind-merge v2 feature request

Comments

@JarolinVargas
Copy link

Will it be possible to add additional functionality to TWM so that's it's able to get the current class assigned given a property name? As well as remove a specific class set?

@dcastil dcastil added the context-v2 Related to tailwind-merge v2 label Dec 22, 2023
@dcastil
Copy link
Owner

dcastil commented Dec 22, 2023

Hey @JarolinVargas! 👋

Hmm I'm not sure if I understand what you mean. Do you have an example?

@JarolinVargas
Copy link
Author

Basically, TWM can tell the difference between arbitrary classes. It would be useful if TWM instead of merging, only returns the class applied, given a string representing the class set. For example ('w') -> returns the class included that matches the 'w' set. So if 'w-full' is applied, return that class rather than merge 'w', causing it to remove 'w-full'

@dcastil
Copy link
Owner

dcastil commented Dec 24, 2023

Ah got it. I see how that could be useful. Currently I don't have the capacity to increase the API surface of tailwind-merge, so I won't be able to build this anytime soon.

But the library is not too large, feel free to fork it and build this feature yourself. 😊

@dcastil
Copy link
Owner

dcastil commented Jan 28, 2024

(referenced in #373)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context-v2 Related to tailwind-merge v2 feature request
Projects
None yet
Development

No branches or pull requests

2 participants