DEV Community

Discussion on: How to love Tailwind

Collapse
 
charliejoel profile image
Charlie Joel

Thanks for your comment!

In this example, I would change tailwind.config.js directly and update the colour class that was used. They work in the same way as variables, so if I had a class called bg-brand-primary, I could update the colour named brand-primary in the config, and this would be reflected everywhere brand-primary is used. In this way, your config file is where you can easily make global changes.

You could name them the same as you would regular CSS variables: css-tricks.com/what-do-you-name-co...

Hope that clears it up, let me know if I've understood you wrong.

Collapse
 
moopet profile image
Ben Sinclair

The problem is, that if you run a takeover on your site - for instance, you have a sale in your shop and everything has little fairies waving wands at prices, and the boxes are all double the size they normally are - these are multiple changes. Yes, you could make everything a variable and put it in your config, but that's unmanageable for anything more complicated than a few simple things.