Replies: 5 comments 2 replies
-
I faced similar problem. const ButtonVariants = cva(
`relative border active:scale-95 transition-all text-button bg-white px-4 py-3 flex items-center justify-center gap-2 rounded-2xl`,
{
variants: {
variant: {
default:
'hover:bg-primary-50 active:bg-primary-300 border-black text-black active:text-white',
primary: 'bg-primary active:bg-primary-500 text-white',
black: 'bg-black text-white',
white: 'bg-white text-black border-black',
noLabel: 'gap-0 rounded-xl border-gray-200 p-2',
blackDisabled: 'bg-black text-white pointer-events-none',
},
},
defaultVariants: {
variant: 'default',
},
},
); Case like above, when 'default' variant is applied, the default class text-button is not applied. While text-black is a color attribute and text-button is a font attribute, once classes applied after the other styles, formal classes are not applied. @theme in globals.css @theme {
...
--color-black: rgba(0, 0, 0, 1);
...
--text-button: 1.0625rem;
--text-button--line-height: 1.4;
--text-button--font-weight: 600;
... If I apply both classes (text-black, text-button) in the same layer, they work. I'm not sure the Tailwind 4.0 is malfunctioning, but this has never happened in tailwind 3. Maybe twmerge is not working properly. |
Beta Was this translation helpful? Give feedback.
-
I ran into this issue as well. It seems to be exclusive to Google Chrome on my end, although I haven't tested this extensively with different browsers. I found that making the placeholders important fixes the issue. |
Beta Was this translation helpful? Give feedback.
-
This should be in issues - placeholder color does not change unless you use important. |
Beta Was this translation helpful? Give feedback.
-
I can replicate this too. Only for colors. |
Beta Was this translation helpful? Give feedback.
-
I have created a new issue from this: #18319 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I'm having trouble with placeholder styling in Tailwind CSS v4. Specifically, the placeholder text color and size classes are not being applied, while other placeholder styling properties work correctly. I'm wondering if this is a bug or if I'm missing something in my implementation.
What I'm trying to do
I have a custom Input component that wraps a base input component, and I'm trying to style the placeholder text using Tailwind's placeholder utilities.
What's working and what's not
placeholder:italic
andplaceholder:font-semibold
are correctly appliedplaceholder:text-sm
(font size) is not applied to the placeholderplaceholder:text-gray-400
(text color) is not applied to the placeholderThis suggests that the placeholder modifier itself is working, but specifically the text size and color utilities are not being applied to placeholders.
What I've tried
[&::placeholder]:text-gray-400
Environment
Questions
Any help or guidance would be greatly appreciated! If this turns out to be a bug, I'd be happy to create a formal bug report with any additional information needed.
Beta Was this translation helpful? Give feedback.
All reactions