Moving away from Tailwind, and learning to structure my CSS

· web design · Source ↗

TLDR

  • Developer migrates personal sites from Tailwind v2 to vanilla CSS, building a structured system borrowing Tailwind’s reset, color palette, and font scale.

Key Takeaways

  • Kept Tailwind’s preflight reset, CSS custom properties for colors, and rem-based font-size variables to preserve familiar constraints.
  • Organized CSS into discrete component files (one class per component, no cross-component overrides) for isolated, predictable edits.
  • Replaced media-query-heavy responsive layouts with CSS grid auto-fit/minmax and grid-template-areas, which Tailwind cannot express.
  • Used esbuild as an optional production bundler; native CSS @import and nested selectors handle development with no build step.
  • Primary migration drivers: Tailwind v2 frozen at 2.8MB unminified, build-system requirement in v3+, and inability to use @scope, @layer, subgrid, or container queries.

Hacker News Comment Review

  • One commenter argues Tailwind inverts proper HTML/CSS authorship order: semantic meaning should be marked up first, styling second, and Tailwind discourages that discipline.
  • A second comment pivots to LLM-generated vanilla JS as a replacement for framework dependency generally, which is tangential to the CSS migration topic.

Original | Discuss on HN