Variations on colours are removed when extending the main colour #17158
Answered
by
wongjn
chrisgjarrett
asked this question in
Help
-
Tailwind` version: 3.4.1 I'm using tailwind in a NextJs project and have a question about overriding/extending colours. I have a tailwind.config.ts file where I have extended the colors palette like so:
I would have expected this to only override red, e.g. bg-red, text-red. It does this, but also seems to prevent me from using colours such as bg-red-200, bg-red-300. Is there a way of retaining the variations on each colour, other than having to rewrite them into the colors field? |
Beta Was this translation helpful? Give feedback.
Answered by
wongjn
Mar 13, 2025
Replies: 1 comment 1 reply
-
Use the special const config: Config = {
theme: {
extend: {
colors: {
- red: '#000000'
+ red: {
+ DEFAULT: '#0000000',
+ },
}
},
},
plugins: [],
}; |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
chrisgjarrett
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use the special
DEFAULT
key: