Custom font-size and color conflict #19260
Unanswered
yasinitskyi asked this question in Help
Replies: 2 comments 2 replies
-
| Sounds like you might be using a package like |
Beta Was this translation helpful? Give feedback.
1 reply
-
| I was having the same problem, and was about to create a discussion here too. After reading @wongjn's comment, I visited the twMerge website and searched for this configuration, and it now works perfectly. import { type ClassValue, clsx } from "clsx"; import { extendTailwindMerge } from "tailwind-merge"; const twMerge = extendTailwindMerge({ extend: { theme: { text: ["xxs"], }, }, }); export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What version of Tailwind CSS are you using?
"^4.1.9"
What build tool (or framework if it abstracts the build tool) are you using?
"next": "16.0.0"
What version of Node.js are you using?
For example: v22.0.0
What browser are you using?
Chrome
What operating system are you using?
macOS
Describe your issue
Custom font-size defined in global.css with
--text-conflicts with custom colors defined with--color-, the last one in layout will be applied:text-xxsis applied andtext-custom-accent-highlightentirely ignored, even won't appear in html tree.text-custom-accent-highlightis applied andtext-xxsentirely ignored, even won't appear in html tree.global.css:
Outsmarting tailwind like this won't work either:
Beta Was this translation helpful? Give feedback.
All reactions