I have added custom colors to my TailwindCSS project, however, when I try and use a built-in color such as text-blue-200 it is not recognized within the HTML file.
Any idea what this could be?
Here is my tailwindconfig file
module.exports = {
content: ['./public/**/*.{html, js}'],
theme: {
colors: {
transparent: 'transparent',
current: 'currentColor',
'golden': '#cdaa60',
'light-brown': '#6b5635',
'dark-brown': '#433627',
'light-green': '#848468',
'dark': '#141115',
'light': '#fff',
'black': '#000',
'error': '#ff6961'
},
fontFamily: {
redressed: ['Prata', 'serif']
}
},
plugins: [],
}
As per the documentation, when you add configuration directly in the
themeproperty "will completely replace Tailwind’s default configuration for that key." Thus, by providing color configuration intheme.colors, your provided colors will completely replace the Tailwind default color values. Since you don't haveblue-200orblue.200in your colors, this no longer exists and no CSS rule fortext-blue-200is built by Tailwind.If you would like to retain the Tailwind default colors, you should consider defining your extra colors in
theme.extend.colors, as per the documentation: