Closed
Description
What version of Tailwind CSS are you using?
v4.0.12
What build tool (or framework if it abstracts the build tool) are you using?
SvelteKit 2.18.0
What version of Node.js are you using?
v22.14.0
What browser are you using?
Chrome
What operating system are you using?
macOS
Reproduction URL
https://github.com/DarthGigi/tailwind-v4-text-shadow-mvce
Describe your issue
Using a custom plugin to add text shadows causes tailwindcss to override the text size property, thinking text-shadow
is a text size utility while it's not.
This worked fine in v4.0.5 last time I checked, I'm not sure which release introduced this behavior.
Plugin code
import plugin from "tailwindcss/plugin";
const textShadowPlugin = plugin(function ({ matchUtilities, theme }) {
matchUtilities(
{
"text-shadow": (value) => ({
textShadow: value
})
},
{ values: theme("textShadow") }
);
});
export default textShadowPlugin;
app.css
@import 'tailwindcss';
@plugin "./plugins/text-shadow.ts";
@theme {
/* Text Shadow */
--text-shadow-sm: 0 0px 2px var(--tw-shadow-color);
--text-shadow: 0 0px 4px var(--tw-shadow-color);
--text-shadow-lg: 0 0px 8px var(--tw-shadow-color);
--tw-shadow-color: --alpha(oklch(0 0 0) / 50%);
}
Metadata
Metadata
Assignees
Labels
No labels