Skip to content

Guide to convert colors from regular TailwindCSS to TailwindUI #2214

Answered by simonswiss
iquito asked this question in Help
Discussion options

You must be logged in to vote

If you want to bring the new color palette to Tailwind, you can turn on the uniformColorPaletteflag under the experimental features.

If you want to do the reverse, and bring the old colors to Tailwind UI (as mentioned in this thread), you can reference Tailwind's default theme like so:

const defaultTheme = require('tailwindcss/defaultTheme')

Since Tailwind UI brings a few new colors (-50 shade for each color, new cool-gray color), you can't just replace theme.colors with defaultTheme.colors, or you would lose these new additions and break a lot of the components.

Instead, what you want to do is deep merge the Tailwind UI colors with the default colors.

Merging the color objects

One way to…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by simonswiss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #2214 on August 21, 2020 04:24.