Syntax - Tasty Web Development Treats
Syntax - Tasty Web Development Treats

Hasty Treat - Why Do People Hate CSS?

In this Hasty Treat, Scott and Wes talk about why people hate CSS, some common issues, and how you can level up. Prismic - Sponsor Prismic is a Headless CMS that makes it easy to build website pages as a set of components. Break pages into sections of components using React, Vue, or whatever you lik

Featured Speakers

Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers Host

Topics Discussed

Episode Summary

Executive Summary: The episode argues that CSS deserves less ridicule than it gets, because modern features and good practices have solved many historical pain points. Scott and Wes explain that most CSS frustration comes from weak fundamentals, poor scoping/specificity habits, and messy project organization—not from CSS itself. They emphasize Flexbox/Grid, devtools, BEM/CSS modules, avoiding IDs and !important, and treating CSS as a first-class part of the system.

Main Topics: Why CSS gets a bad reputation: The hosts discuss the meme culture around CSS and argue that many complaints are outdated, especially compared to CSS from 10–15 years ago. Fundamentals: block, inline, cascade, and specificity: They stress that understanding basic layout flow and the cascade is essential to working effectively with CSS. Modern layout tools: Flexbox and Grid: Flexbox and Grid are presented as the main reasons CSS layout is no longer inherently difficult, replacing older float-based approaches. Scoping and maintainability: They explain how poor scoping leads to messy styles and recommend BEM, CSS modules, and CSS-in-JS to manage larger codebases. Debugging with devtools: The episode highlights using the browser styles tab to inspect specificity, overrides, and missing styles when something looks wrong. Avoiding CSS foot guns: They advise against styling with IDs and overusing !important because these patterns create specificity problems and brittle code. Cleaning up or rewriting bloated CSS: The hosts discuss using tools like PurgeCSS and, in some cases, rewriting old CSS entirely rather than endlessly patching it.

Key Arguments: Most CSS complaints are rooted in outdated experiences; modern CSS is far easier to use than it used to be. Learning the difference between inline and block elements and understanding the cascade solves a large share of CSS confusion. Flexbox and Grid have removed the need for float-based layout in most cases, making layout much simpler. Good scoping practices prevent CSS from turning into a tangled, hard-to-maintain mess. IDs should not be used for styling because classes are more reusable and avoid specificity headaches. !important should be treated as a last resort because it often signals a deeper problem in the stylesheet architecture. Devtools are essential for diagnosing why a style is or is not applying. In legacy projects, deleting unused CSS or rewriting from scratch may be more efficient than continuing to patch broken styles. CSS should be treated as a first-class engineering decision from the start of a project, not as an afterthought.

Data Points: Historical timeframe: 10-15 years ago - Referenced as the period when CSS was much harder to work with, especially for layout. Sponsor raise amount: $20 million - Prismic mentions raising 20 million bucks to scale content creation with slices. Free trial length: 14 days - LogRocket offers 14 days free through the syntax.fm link. Historical code reduction example: Hundreds of lines - A cited blog post described saving hundreds of lines of CSS through optimization. Legacy optimization example: 10,000 lines - The hosts reference a separate example of saving roughly 10,000 lines of CSS, though one speaker notes it may be misremembered. Rewrite reduction estimate: 10% or even 5% - One speaker suggests a full CSS rewrite could reduce the codebase to about 10% or 5% of its original size.

Pivotal Quotes: "CSS is awesome and it's just a square or just a rectangle." — Wes: He jokes about making a sticker that turns the meme into a positive statement about CSS. "Do not use important." — Wes: A strong warning against using !important as a routine workaround for specificity problems. "If you're struggling with understanding CSS or you're finding CSS to be hard, keep in mind, just focus on your fundamentals of learning it." — Scott: Closing advice that reframes CSS difficulty as a learning issue rather than a flaw in CSS itself.

Implications: Listeners should invest in CSS fundamentals and modern layout tools, use devtools and scoping patterns to prevent chaos, and treat CSS architecture seriously from the start to avoid costly rewrites later.

🔓 Sign Up for Unlimited Episode Search

About Syntax - Tasty Web Development Treats

View all episodes from Syntax - Tasty Web Development Treats