DEV Community

Discussion on: Building a responsive navbar component in Tailwind CSS

Collapse
eboye profile image
eboye

To be perfectly honest, I thought the same. But then I dug deep into TW and released and massive project done with it.

From my perspective:

  • It's very fast to develop with
  • The compiled css file is as tiny as it gets
  • When you are done with prototyping, you can always extract classes and replace them with @apply in your scss

class="bg-app_orange text-white rounded text-sm py-3 px-4 hover:bg-app_green group transition-all hidden md:block"

becomes:

class="btn"

.btn {
@apply bg-app_orange text-white rounded text-sm py-3 px-4 hover:bg-app_green group transition-all hidden md:block;
}

Collapse
z2lai profile image
z2lai

Ah, that's amazing! If this is the standard approach for using it in an actual application, then it should always be mention in every article so that newcomers aren't scared away. Thanks a lot for sharing that example!

Thread Thread
eboye profile image
eboye

You are welcome :)

I was strongly against css class bloat in html, but when I realized this ... the whole new world opened up :)