Moving away from Tailwind, and learning to structure my CSS

TL;DR

A developer has begun moving away from Tailwind CSS towards organizing CSS with semantic HTML and component-based styling. This shift aims to improve maintainability and clarity in their projects. The process involves adopting Tailwind-inspired systems while developing new conventions.

A developer has started transitioning from Tailwind CSS to a more traditional, structured CSS approach, aiming for better maintainability and clarity in their projects. This shift reflects a broader trend among developers seeking more control and organization in their styling workflows.

The developer, who has used Tailwind for eight years, recently migrated a couple of sites away from it towards semantic HTML and vanilla CSS. They adopted Tailwind’s reset styles, organized CSS by components with unique classes, and created guidelines for colors, font sizes, and utilities. This process involved copying Tailwind’s preflight styles, defining component-specific CSS, and establishing conventions for consistency.

While the developer has not yet implemented programmatic scoping like web components, they are applying a naming convention to prevent style conflicts. They also maintained Tailwind-inspired color variables and font size variables for familiarity, though with more verbosity. The transition is ongoing, with plans to refine spacing management and further develop their CSS architecture.

Why It Matters

This development matters as it illustrates a practical shift from utility-first frameworks to component-based CSS, emphasizing maintainability, clarity, and control. For developers considering similar transitions, it highlights challenges and strategies for managing complex styles without relying solely on utility classes. It also reflects evolving best practices in frontend development towards more semantic and organized codebases.

Frontend Styling with Styled Components and React: Applied Guide for Dynamic UI Design

Frontend Styling with Styled Components and React: Applied Guide for Dynamic UI Design

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background

Tailwind CSS gained popularity over the past few years for its utility-first approach, simplifying styling for many developers. However, some users find that as projects grow, managing large utility class lists becomes cumbersome and less maintainable. This developer’s move signals a desire for more explicit, component-oriented CSS structures, which have been gaining traction as an alternative to utility frameworks. The transition is part of a broader conversation about balancing rapid development with long-term code clarity.

“It was SO fun and SO interesting to migrate away from Tailwind and organize my CSS by components. I think this will make my projects more maintainable in the long run.”

— the developer

“I copied Tailwind’s reset styles and adopted similar systems for colors and font sizes, but I want to enforce more conventions and clarity going forward.”

— the developer

Amazon

CSS naming convention guides

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What Remains Unclear

It remains unclear how fully the developer will implement advanced scoping techniques or how the new system will scale for larger projects. The long-term effectiveness of this approach compared to utility frameworks is also yet to be evaluated.

Amazon

CSS reset styles for developers

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What’s Next

The developer plans to refine their CSS conventions, especially around spacing and layout management. They will also monitor how this new structure impacts development speed and maintainability, potentially adjusting their approach based on future needs.

Amazon

CSS variables for colors and fonts

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

Why is the developer moving away from Tailwind?

The developer seeks more control, clarity, and maintainability in their CSS codebase, especially as projects grow more complex.

Will this approach be scalable for larger projects?

The developer is still testing scalability; they plan to develop conventions and possibly incorporate more scoped styling techniques in the future.

What are the main benefits of this new method?

Improved organization, easier component management, and clearer separation of concerns in CSS.

Are there any drawbacks or challenges?

Initial setup and learning curve, especially around spacing and layout management, and the potential need for more manual effort compared to utility classes.

You May Also Like

The Speed of Prototyping in the Age of AI

AI has drastically sped up prototyping workflows, enabling engineers to move from idea to working prototype in hours, not days, transforming software development.

Cheese Paper: a text editor specifically designed for writing

Cheese Paper is a dedicated writing tool for authors, offering seamless note-taking, scene management, and syncing features tailored for fiction writers.

One markdown file, publish-ready for every platform

A web tool now allows creators to convert a single markdown file into platform-ready formats, streamlining content distribution for independent creators.

The 3 Chair Adjustments to Try First (Before Anything Else)

Balancing your chair adjustments properly can transform your comfort, but discover the key first steps to optimize your workspace perfectly.