What if you could change your entire website's colors by updating just one file?
Why Extending default theme values in Tailwind? - Purpose & Use Cases
Imagine you want your website colors to match your brand exactly. You try to add new colors by writing custom CSS everywhere.
Manually writing CSS for every new color is slow and messy. It's easy to make mistakes and hard to keep styles consistent across pages.
Extending Tailwind's default theme lets you add your own colors and styles in one place. Then you can use them easily with Tailwind's utility classes everywhere.
/* CSS */
.brand-blue { color: #123456; }
.brand-blue-bg { background-color: #123456; }/* tailwind.config.js */
module.exports = {
theme: {
extend: {
colors: { 'brand-blue': '#123456' }
}
}
}You can keep your design consistent and update your brand colors quickly across the whole site with simple class names.
A company wants their website buttons and links to use their exact brand blue. By extending Tailwind's colors, developers just use text-brand-blue or bg-brand-blue classes everywhere.
Manually adding styles everywhere is slow and error-prone.
Extending Tailwind's theme centralizes custom styles.
It makes using and updating brand styles easy and consistent.