DEV Community

Discussion on: React + TailwindCSS + Vite.js = a Match made in Heaven?

Collapse
 
akramnarejo profile image
Akram Narejo

thanks for the really good article, one thing I want to ask what if we need to customize the tailwind then won't we need to run any command or an extra css file to convert the actual css to back in tailwind. just confused in this matter.

Collapse
 
rjzauner profile image
RoryJZauner

Hi :) thank you for your question - customizing Tailwind tends to happen in the tailwind.config.js file.

If you wanted to create a new primary colour:

// tailwind.config.js
const colors = require('tailwindcss/colors')

module.exports = {
theme: {
colors: {
brand-primary: colors.lightBlue,
brand-danger: colors.rose,
brand-gray: colors.coolGray,
}
}
}

That way you would have a class with the name "brand-primary" available throughout your project and do not have to write any extra CSS.

You can of course use CSS Rules if you need to, Tailwind does not prevent you from doing so.

Hope that answers your question!

If not let me know, I am glad to reply!

Collapse
 
akramnarejo profile image
Akram Narejo

Thanks for the answer.