-
|
I am using tailwind 4.1.3, But I met a problem, my custom varible not working. I have add but in browser, there is no class called bg-my-custom-bg, why? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
You're using v4, which doesn't automatically use the @theme {
--color-my-custom-bg: green;
/* Or */
--background-color-my-custom-bg: green;
} |
Beta Was this translation helpful? Give feedback.

You're using v4, which doesn't automatically use the
tailwind.config.jsfile. Since thetailwind.config.jsis considered legacy, consider configuring Tailwind in the CSS file. Thus, add insrc/index.css(orsrc/variable.csssince that is@imported bysrc/index.css):