

816: Why Your CSS Sucks
Sep 2, 2024
Explore why your CSS might be a mess, from misusing specificity to styling the wrong elements. The hosts share practical tips to fix common pitfalls and enhance your stylesheets. Learn about the benefits of CSS variables, the importance of using Flexbox and Grid properly, and the challenges of scoping your CSS effectively. Plus, enjoy a fun diversion into the rising competitive landscape of women's breakdancing and the impact of innovative footwear. Tune in for a blend of humor and valuable insights!
AI Snips
Chapters
Transcript
Episode notes
Open-Source CSS Struggles
- Scott Tolinsky struggles contributing to open-source projects with poorly written CSS.
- He finds it difficult to resist rewriting messy code, even in relatively new projects.
Styling the Right Element
- Avoid styling the wrong element; ensure correct element receives properties like height or display.
- If you over-apply styles, step back and adjust the correct parent or child element.
Embrace Fluidity
- Embrace fluidity in CSS; avoid hardcoding widths and heights.
- Let content define size, using max/min widths and other properties instead.