-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add line-height
modifier support to font-size
utilities (introduced in Tailwind CSS v3.3)
#211
Comments
@adamwathan Hope it's okay to reach out to you here. Do you think it's reasonable to expect that people don't use |
@dcastil Hey! So people do use |
Ah yes, forgot about those. 😅 Okay that makes a lot of sense! Then I'll replicate this behavior by first looking for Thanks for your input! |
Note to myself: Going with option 2,
|
This was addressed in release v1.12.0. |
This issue is about adding support for the line-height modifier introduced in Tailwind CSS v3.3 (announcement, pull request).
I separated that feature into a separate issue from the Tailwind v3.3 support PR because the dynamic nature of the modifier makes it a bit tricky to implement in tailwind-merge.
Tailwind allows to use
/
in Tailwind classes, e.g. you could use the color namered/10
which would produce classes liketext-red/10
(the10
is not a modifier in this case). This makes the postfix modifier very difficult to detect. tailwind-merge can't know whether the/
character marks the transition to a postfix modifier or whether it's just part of the name (at least in the current default config with usingvalidators.isAny
for colors).Moreover, with the implementation of a generalized postfix modifier in tailwindlabs/tailwindcss#9541 I think we might see more postfix modifiers out there, so it makes sense to think about a generalized solution for tailwind-merge to prevent more breaking changes in the future.
I see several paths forward:
1.
Every(see #211 (comment))/
is a modifierDetect something that could be a potential postfix modifier
splitModifiers
and remove it from thebaseClassName
.Pros:
Cons:
/
character in classes outside of arbitrary values ([<here>]
) since it will assume it is a modifier. This would be a breaking change in tailwind-merge. The question here is how many people use/
in their Tailwind theme names.2. Every
/
can be a modifierSame like 1 but if we don't find a match for the base class with modifier, we perform another search for the base class without modifier as it could be part of a name.
Pros:
Cons:
/
in their name which has runtime cost.3. Config for which classes have modifier
Add the ability to specify which classes have modifiers to the tailwind-merge config. This could be implemented in several levels of precision vs. brevity.
Pros:
Cons:
Other
The text was updated successfully, but these errors were encountered: