Customizing the primary color #162
Replies: 6 comments 16 replies
-
Hey @lewebsimple, This is something that we've been exploring the past few weeks, but we're still not 100% decided on this aspect. The advantage is quite obvious, that per project base it is much easier to change the primary/secondary/tertiary colors, however, it will mean that we'll have to introduce a class that is not available with a default Tailwind configuration. We will do this change if this request will have enough traction and demand. Overall, we would like to keep all of the components as little opinionated as possible in comparison with Tailwind CSS. Edit: I'll transfer this to the Github discussions area. |
Beta Was this translation helpful? Give feedback.
-
Not sure if this helps but this how I set up a Material Theme in tailwind.config.cjs. This seems to give you maximum flexibility in your components. Not crazy about the setup for dark mode. It is what it is. I used Shades Generator to help in the color generation.
|
Beta Was this translation helpful? Give feedback.
-
How to customize the ring for each input (forms)? |
Beta Was this translation helpful? Give feedback.
-
Hey peeps 👋 We'll provide an update for Flowbite where instead of using "blue" we'll use "primary" which can be easily set via the config file. This means that overriding the primary variable in the config file will also change focus state colors for checkboxes, input fields, and other pseudo selectors. Will probably drop for v1.6.3. Cheers, |
Beta Was this translation helpful? Give feedback.
-
could you provide the document or example to set this. I found some problem related to global css when try to update the tailwind.config.js. thank a lot more context I use nextJS |
Beta Was this translation helpful? Give feedback.
-
I think I found a way that makes a bit more sense than overriding the entire theme and loosing access to primary colors. TLDR; Explanation for those who really need it: But there is hope! TailwindCSS puts the classes defined after |
Beta Was this translation helpful? Give feedback.
-
The various components use a hard-coded blue color, it would be nice to make this customizable.
Describe the solution you'd like
Defining a
primary
color variable and using this instead ofblue
would allow the primary color to be overridden on a per-project basis. Its default values can still be set to blue to make this change transparent to the user.Describe alternatives you've considered
Manually overriding the generated CSS is out of the question, what I'm doing right now is setting
blue
to my desired color but this prevents from using blue elsewhere in the code.Additional context
This is similar to what DaisyUI does.
Beta Was this translation helpful? Give feedback.
All reactions