DEV Community

Discussion on: A simple strategy for structuring TailwindCSS classnames

Collapse
 
shareef profile image
Mohammed Nadeem Shareef

I like to use componentName.module.css

  • We will have separate files
  • We can combine the CSS power with the tailwind
  • We will have a simple but powerful structure also.
Collapse
 
wheelmaker24 profile image
Nikolaus Rademacher • Edited

And within the CSS file you would @apply the Tailwind utility-classes? That's definitely a good approach. Although you will still end up with specific stylesheets for each component. Would be similar to SCSS with mixins IMO.

Collapse
 
shareef profile image
Mohammed Nadeem Shareef

yeah! it will be similar to SCSS and we can use the power of scss and tailwindcss combined, and yes I use @apply.

Thread Thread
 
nemethricsi profile image
Richard

But the slogan is that “you should never leave your markup”.

If I should create separate files for the styles I feel I did not reduced the mental work here :/