I’m trying to create a custom color and name it primary
but it doesn’t seem to work. It works when using other names but it feels like there should be a way to naming it primary
? What am I missing?
tailwind.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {
colors: {
primary: "red",
},
},
},
plugins: [],
};
example.jsx
<nav class="flex items-center justify-between flex-wrap bg-primary p-6">
...
</nav>
2
Answers
It seems like problem is with your config according to tailwind docs. Removing
extends
is how it should work. Your code will becomeProbably you’re using pre-built tailwind.css that’s why your changes is not affected, please check your project "style build" scripts under package.json if you’re using some kind boilerplate