Can't get custom colors working via "theme.extend" #3106
-
|
Hi all, Currently using Tailwind with Next.js, installed with the official guide. I followed the documentation page to[ extend my colors](const colors = require('tailwindcss/colors')), this is how my config looks: Despite this I can't seem to get Any idea what this could be caused by? The process seems really simple so I'm struggling to think of what the problem could be. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Nevermind I'm an idiot. |
Beta Was this translation helpful? Give feedback.
-
|
Hello! 👋 Looks like you're missing the const colors = require('tailwindcss/colors');
module.exports = {
purge: ['./pages/**/*.tsx', './components/**/*.tsx'],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {
+ colors: {
emerald: colors.emerald,
+ }
},
},
variants: {
extend: {},
},
plugins: [],
};That should do it 👍 |
Beta Was this translation helpful? Give feedback.
Hello! 👋
Looks like you're missing the
colorskey in yourextend:const colors = require('tailwindcss/colors'); module.exports = { purge: ['./pages/**/*.tsx', './components/**/*.tsx'], darkMode: false, // or 'media' or 'class' theme: { extend: { + colors: { emerald: colors.emerald, + } }, }, variants: { extend: {}, }, plugins: [], };That should do it 👍