DEV Community

Discussion on: Why Tailwind Isn't for Me

Collapse
paceaux profile image
Paceaux

I haven't used Tailwind, but I have heard lots of hype. This is incredibly insightful as it's a reasoned criticism. With what you've shared, I can add some additional criticisms.

I've worked in the content management system space for 12 years, 10~ as a developer. I can say that, based on what you've shared, Tailwind wouldn't play nicely with an enterprise CMS.

An enterprise CMS is likely "detached" from the web site/application; they are two separate codebases. The website consumes content from some API or repository where there may be some sort of relationship between content and presentation of content... basically I have one "article" that may look like four different things, depending on where it goes.

I often have a server-side MVC app whose job it is to render these pages, and that app is usually written in .net. This means there's a division of labor where front-end people are writing a "static" version of a component and a back-end person is slicing up the HTML for the MVC app.

Tailwind would not play well for my line of work because it doesn't separate concerns: It's putting presentation rules in markup where they could exist collectively in styles.

A very common scenario I deal with is "conditional content"; if a subtitle is present, the title must look differently (reduced line-height, margin, etc).

The Tailwind approach means that my back-end developer must write logic around my <title> to add some classes, but on account of the presence of a <subtitle>. This means I have to write a clear business rule in my markup to explain to the back-end developer how "conditional classes" work.

Additionally, because Tailwind wants a crapload of classes, this means that, potentially, I have to write a crappierload of documentation to explain to the back-end dev how they're used.

Add to this that, Tailwind's desire to offload all presentation work to markup, this means that my client requesting a change to something "small" like a subtitle requires two codebases to be touched and tested, since every change requires me to update the .net application.

Tailwind seems to be useful for scenarios where the front-end developer owns the markup and there isn't a need for multiple presentations of that markup.

Collapse
codyseibert profile image
Cody Seibert

Agreed, and the core issue is you’ll never know when you may need multiple presentations, so don’t code yourself into a corner and keep your code flexible