Hello, your code looks ok, it might be related to the cache. Also, consider put your extended colors into extend : { } see https://v2.tailwindcss.com/docs/customizing-colors#extending-the-defaults
Dec 13, 2021
16
Level 12
How to customize theme TailwindCSS colors in a Laravel project?
I want to use something like bg-magenta on a parent div, so I do the following:
- In
tailwind.config.js:
theme: {
colors: {
'magenta': '#ff00ff',
}
},
- Run
npm run dev
Result: I don't see the magenta color when I use it inside a div.
This has never worked smoothly for me, most of the time I stick with the defaults colours or when it does work it's after a while, like an hour after and I don't know what causes it to change. I have seen some videos here on Laracasts where they go through the exact same process but after they run npm run dev it works as soon as the page is refreshed. Has anyone experienced this before?
Please or to participate in this conversation.