From the journal

React Series #05: How to change primary and secondary color in Next.js Tailwind projects.

Tailwind has quite a few color options, here is a basic introduction to how Tailwind uses color followed by how to edit the basic color. How to use color in Tailwind Open tailwind.config.js and edit…

Explore this page ↓
React Series #05: How to change primary and secondary color in Next.js Tailwind projects
React Series #05: How to change primary and secondary color in Next.js Tailwind projects
Share

Tailwind has quite a few color options, here is a basic introduction to how Tailwind uses color followed by how to edit the basic color.

How to use color in Tailwind

Open tailwind.config.js and edit

        primary: {
          DEFAULT: "hsl(var(--primary))",
          foreground: "hsl(var(--primary-foreground))",
        },

Change this to

        primary: {
          DEFAULT: "#36BA98",
          foreground: "hsl(var(--primary-foreground))",
        },

How to use primary color in the project

simple use

<div className="bg-primary">....</div>

That is how you update your project color and use it across your project.

Keep reading