https://blog.jim-nielsen.com/2022/things-the-css-spec-folks-got-right/ Jim Nielsen's Blog ArchiveTagsAboutFeeds Things the CSS Spec Folks Got Right 2022-02-22 I read this article which examines why CSS is the way it is from the perspective of a technical director at the W3C. It's easy, in hindsight, to critique things CSS got wrong or should've prioritized differently. But I want to take a moment to marvel at the things they got right. It's incredibly difficult to build APIs that solve today's problems while anticipating an unknown future. In some cases, I think the original CSS authors did precisely that. This post is a shout out of appreciation for the things they got right. Font Weight font-weight could've shipped with a few values that were likely practical at the time: * Light * Regular * Bold But what about adding new weights -- something between "Regular" and "Bold"? Make a new name I guess: * Light * Regular * Medium * Bold Ok, but then later you need something between Medium and Bold. Now what? Another name: * Light * Regular * Medium * Semibold * Bold As you can imagine, this gets tricky fast. It's common to see a family today whose spectrum of weight variations are named like this: * Ultralight * Thin * Light * Regular * Medium * Semibold * Bold * Ultrabold * Heavy * Black And what about when you want even more variations? Switching from named enumerations to numbers makes sense. For example, a set of digits 1-9. But what about when you need something between a 4 (Regular) and a 5 (Medium)? 4.5? "Ok, let's go with a scale of 100-900 to represent font-weight" -- which is precisely what they originally came up with. Could the original spec writers have envisioned what we have today with variable fonts? I can't say. Regardless, their foresight in enumerating font-weight values and anticipating a path for growth was spot on in hindsight. CSS Imports Remember when import statements made it to JavaScript in ES6? They facilitated modular encapsulation and completely transformed how we write and deliver code on the web, marking the start of The Great JavaScript Gold Rush of the late 2010's. CSS was doing imports way before JS. CSS imports : 2002 JS imports: 2015 HTML imports: [insert date @davatron5000 passed away here] -- @jimniels on Twitter Granted, there is a lot of advice out there recommending you avoid CSS imports due to render blocking. But nobody stops using