Home / Companies / LogRocket / Blog / Post Details
Content Deep Dive

What should a modern CSS boilerplate look like?

Blog post from LogRocket

Post Details
Company
Date Published
Author
Daniel Schwarz
Word Count
1,964
Language
-
Hacker News Points
-
Summary

CSS boilerplates, which are sets of pre-defined CSS rules, are designed to simplify the initial setup of web projects by providing a foundational framework that developers can build upon. While they can expedite the process of getting CSS up and running, popular boilerplates often include excessive and unnecessary rules that assume too much about the needs of a typical website, leading to what some might call "bloatware." The text emphasizes the importance of creating a minimal, predictable, and maintainable CSS boilerplate by focusing on essential rules such as resetting the box model with `box-sizing: border-box`, controlling image behavior, adjusting link underlines, and setting the root font size for accessibility. It suggests that developers carefully consider and regularly review their CSS boilerplates to ensure they remain efficient and purposeful, drawing parallels to design system versioning. Additionally, the text highlights the importance of making informed decisions about CSS resets, margins, borders, and list styles, while promoting practices like smooth scrolling and providing interactive elements with pointer cursors.