4 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
This article lists various mistakes in CSS design and implementation, along with proposed corrections. It covers issues like naming conventions, property behavior, and layout challenges that affect usability and consistency. The suggestions aim to improve CSS functionality and developer experience.
If you do, here's more
The article critiques various CSS properties and suggests improvements based on historical context and usability. For instance, it points out that `white-space: nowrap` should have been `white-space: no-wrap` since the latter more accurately describes its function. The author argues for changes like making `animation-iteration-count` simply `animation-count`, akin to `column-count`, and expresses a preference for `text-middle` or `x-middle` instead of `vertical-align: middle`, which can be misleading.
The author also highlights several problematic defaults in CSS. Percentage heights, for instance, should be calculated against `fill-available` to avoid undefined results. The article indicates that the default for `background-repeat` should have been `no-repeat`, reflecting modern design needs. It critiques the margin collapsing behavior and suggests that it leads to confusion, proposing that the currentColor keyword should have retained its original dash in the name. The need for a predictable color naming system is emphasized, as the current X11 names are seen as arbitrary.
Further, the article identifies inconsistencies in CSS syntax and functionalities. It suggests that properties like `hyphens` should be renamed to `hyphenate` for clarity, and that the `flex` shorthand should accept `fr` units instead of just numbers. It also points out issues with the `@import` rule, which creates separate CSSStyleSheet objects for each import, suggesting a need for better deduplication. The author argues that alignment properties in Flexbox should be more intuitive and relative to writing modes, and that comments shouldnโt be allowed everywhere, as this complicates the object model. Overall, the piece highlights a range of missed opportunities to make CSS more logical and user-friendly.
Questions about this article
No questions yet.