MITB Banner

Why Devs Can’t Turn Back After Using Tailwind CSS

Tailwind says reject semantic CSS and go toward utility CSS.

Share

Listen to this story

Developers are the quickest to jump on any hype train that promises even the smallest improvements and ‘Tailwind’ is the latest target of this trend. This CSS framework has become quite divisive in the front-end programming community, with many thinking that it’s the best thing since sliced bread. 

Of course, its critics have dismissed it as just another flashy new framework. As with anything, the truth is somewhere in the middle. However, one thing is for certain—once devs start using Tailwind, there’s no turning back

What makes it special? 

Tailwind has been in development since November 2017 but it really exploded onto the scene at the beginning of 2022. The creator of the framework, Adam Wathan, has spoken at length about his dislike for semantic CSS. This led him to building Tailwind, which throws semantic CSS out of the window in favour of a utility-focused CSS approach.

Semantic CSS refers to the process of naming various HTML elements with names that have a meaning. For example, instead of naming a checkout button something like ‘bottom red box’, it can be named ‘checkout’. However, when following this approach, devs are generally asked to semantically name the content in HTML while using these class names as hooks in CSS. 

This approach is generally used to allow devs to swap out stylesheets if they want to change the visual style of the website without breaking compatibility. Wathan’s approach, as detailed in his blog, was to optimise for reusable CSS mixed with HTML, a general deviation from the separation of concerns that semantic CSS follows. This is one of the main talking points when it comes to Tailwind. 

Tailwind mainly applies CSS by creating small and simple classes that can be directly applied to HTML elements, reducing the amount of CSS code that needs to be written. 

However, just as these features make things easier for a subset of developers, they’re a no-go for another group. The small class-focused approach of Tailwind generally results in a difficult-to-read HTML file and long lines of code. The ‘restrictive’ nature of Tailwind is also brought up as a common drawback because it only allows for a small subset of CSS styles to be used. With so many issues, developers are beginning to question: Is Tailwind overhyped?

Beyond the hype

Apart from the legion of tech bros claiming milliseconds of faster load times while using Tailwind, there are multiple other reasons for using it. Even though the learning curve might be unpalatable for veterans of semantic coding styles, the benefits are numerous. Even the creator of Tailwind couldn’t stomach changing his coding style until he did, stating,

“The truth is you’re never going to believe me until you actually try it. If you can suppress the urge to retch long enough to give it a chance, I really think you’ll wonder how you ever worked with CSS any other way.”

Indeed, the Tailwind website is filled with positive reviews of the benefits coders gained from working with the framework. Many devs echo the fact that semantic CSS was a mistake, with another common point being that devs can’t go back to ‘normal’ CSS after working with Tailwind. 

The framework also comes with a host of nice-to-haves, such as strong defaults that can be customised as per the users’ preferences, support for responsive websites and automatic cleanup of unused CSS classes. These features resemble automated ‘best practices’, which will definitely smoothen team projects. After relying on these features, it becomes difficult for devs to do them manually after switching away from Tailwind. 

The restricted nature of Tailwind is also a godsend for newer developers, who only need to refer to a single source of documentation rather than trawling through the web to find documentation for CSS styles. Tailwind also favours convention over configuration. While this may be blasphemous for developers who prefer the infinite configurability of CSS, it works wonders for both newer developers and larger teams who don’t want to deal with the problems associated with semantic CSS.

Tailwind is also built from the ground up to reject semantic CSS completely, which means that developers must break their hard-coded habits and not use semantic CSS. Using semantics can cause many problems in Tailwind. As stated by user ‘frontendben’ on the Tailwind subreddit, 

“The point of utility CSS is that you should be able to tell what the class is doing with zero context/needing to open the CSS file. CSS is a declarative language. Yes, it can be used to define styles in an imperative way, but that’s often where the biggest headaches in maintaining CSS comes from.”

The battle of Tailwind against semantic CSS, or even the Block Element Modifier or BEM, approach is sure to be a long and arduous one. Semantics are one of the hardest problems to solve in programming but Tailwind might have found the solution by merely skipping over the problem. 

Share
Picture of Anirudh VK

Anirudh VK

I am an AI enthusiast and love keeping up with the latest events in the space. I love video games and pizza.
Related Posts

CORPORATE TRAINING PROGRAMS ON GENERATIVE AI

Generative AI Skilling for Enterprises

Our customized corporate training program on Generative AI provides a unique opportunity to empower, retain, and advance your talent.

Upcoming Large format Conference

May 30 and 31, 2024 | 📍 Bangalore, India

Download the easiest way to
stay informed

Subscribe to The Belamy: Our Weekly Newsletter

Biggest AI stories, delivered to your inbox every week.

AI Courses & Careers

Become a Certified Generative AI Engineer

AI Forum for India

Our Discord Community for AI Ecosystem, In collaboration with NVIDIA. 

Flagship Events

Rising 2024 | DE&I in Tech Summit

April 4 and 5, 2024 | 📍 Hilton Convention Center, Manyata Tech Park, Bangalore

MachineCon GCC Summit 2024

June 28 2024 | 📍Bangalore, India

MachineCon USA 2024

26 July 2024 | 583 Park Avenue, New York

Cypher India 2024

September 25-27, 2024 | 📍Bangalore, India

Cypher USA 2024

Nov 21-22 2024 | 📍Santa Clara Convention Center, California, USA

Data Engineering Summit 2024

May 30 and 31, 2024 | 📍 Bangalore, India

Subscribe to Our Newsletter

The Belamy, our weekly Newsletter is a rage. Just enter your email below.