You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recongnize all text sizes as distinct from colors.
Edit: I read the docs and understand that twMerge treats only clothing sizes (optionally preceded by a number) as text-size. My suggestion is to include the ability to add suffixes/prefixes to the above formula (e.g. text-2xl-suffix), or (more radical and probably problematic) treat all text- classes that contain clothing sizes as text-size.
Environment
tailwind-merge version: 2.6.0
Additional context
Use-case: secondary type scale aside from tw's default (e.g. a fluid one using clamp as in my case)
The text was updated successfully, but these errors were encountered:
We experience the same problem because we have defined custom text sizes (like text-h1, text-h2,...). Our issue was fixed by extending twMerge classGroups "font-size" like that:
The comment above #519 (comment) says it all, that's the intended solution for that. tailwind-merge doesn't have access to your Tailwind config and you have to configure it separately.
Describe the bug
twMerge seems to treat custom text sizes as colors and merges them with colors.
To Reproduce
https://codesandbox.io/p/sandbox/agitated-almeida-zxfjff
Expected behavior
Recongnize all text sizes as distinct from colors.
Edit: I read the docs and understand that twMerge treats only clothing sizes (optionally preceded by a number) as
text-size
. My suggestion is to include the ability to add suffixes/prefixes to the above formula (e.g.text-2xl-suffix
), or (more radical and probably problematic) treat alltext-
classes that contain clothing sizes astext-size
.Environment
Additional context
Use-case: secondary type scale aside from tw's default (e.g. a fluid one using clamp as in my case)
The text was updated successfully, but these errors were encountered: