DEV Community

Discussion on: TailwindCSS @apply - the right approach?

Collapse
 
smndhm profile image
Simon • Edited

Hello, I was facing the same this week, I ended to organise my tailwindCSS like this :

.element {
  @apply bg-red ...;
  // Hover
  @apply hover:bg-green ...;
  // Focus
  @apply focus:bg-yellow ...;
  // Active
  @apply active:bg-blue ...;
}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
pp profile image
Paweł Ludwiczak

I do like this approach!

Collapse
 
hayksaryan profile image
hayk-saryan

Yo may as well just use CSS