-
-
Notifications
You must be signed in to change notification settings - Fork 465
Description
Description
Flowbite currently uses mainly "cyan" as the default color, making it hard (and weird) to customize the primary color (or the main color palette).
Introducing color roles like "primary," "secondary," and "accent"—inspired by frameworks like Material 3—would make theme customization more intuitive and scalable.
Why is this needed?
- Easier Customization: Allow defining roles (e.g.,
primary
) directly in the TailwindCSS configuration. - Consistency: Use semantic roles to ensure a unified and consistent look across components.
- Alignment with Design Standards: Adopt modern practices similar to Material 3, which uses well-defined color roles.
Proposed Solution
Add semantic color roles such as primary
, secondary
, and accent
to the default TailwindCSS theme. These roles can be customized globally in the theme.extend.colors
section.
Example Implementation
module.exports = {
theme: {
extend: {
colors: {
primary: {
50: "#f7f6ff",
500: "#5645f5", // Main primary color
900: "#2a2278",
},
secondary: {
500: "#03DAC5", // Example secondary color
},
accent: {
500: "#FF5722", // Example accent color
},
},
},
},
plugins: [require("flowbite/plugin")],
};
Components would reference roles such as theme('colors.primary.500')
, theme('colors.secondary.500')
, or theme('colors.accent.500')
instead of hardcoding specific colors like cyan.
Relevant Discussion
This proposal addresses concerns raised in GitHub Discussion #973. Developers noted the difficulty of overriding "cyan" as the default, and introducing semantic roles simplifies customization. Material 3’s color roles provide a great reference for this approach.
Conclusion
Introducing semantic color roles like primary
, secondary
, and accent
in TailwindCSS for Flowbite would improve usability, consistency, and alignment with modern design standards. This change reduces confusion and makes theme customization more flexible.
Feedback is welcome!