The Stupidest Style Sheet Name Ever
Published on Mar 25, 2009 (updated Feb 5, 2024), filed under development (feed). (Share this on Mastodon or Bluesky?)
This and many other posts are also available as a pretty, well-behaved ebook: On Web Development.
The last name you want to pick for your style sheet is “style.css”.
Why is “style.css” such a poor CSS file name? The main reason is maintenance. There’s quite a probability—and as we know, web development is all about probability—that even if “style.css” is your project’s only style sheet, more style sheets may follow. (My experience makes me estimate that more than 60% of websites actually use more than one style sheet.)
Only a single additional one would make the name “style.css” look odd at best, as every style sheet contains “styles.” An additional style sheet would either force you to rename “style.css” (and thus force you to update everything referring to that file, too) or confront you with that lapse until the end of time. Both is unnecessary, and hence silly.
It’s true that similar to reasonable ID and class names, functional or generic style sheet names are cool, however “style.css” is not “generic.” Sure-fire core style sheet names are “standard.css” and “default.css” while there are always functional names à la “corporate.css” or “gallery.css” to use, too.
Getting style sheet naming right, which evidently is one piece of the HTML and maintenance puzzle, is not difficult. Start with avoiding names like “style.css”.
About Me
I’m Jens (long: Jens Oliver Meiert), and I’m a web developer, manager, and author. I’ve been working as a technical lead and engineering manager for small and large enterprises, I’m an occasional contributor to web standards (like HTML, CSS, WCAG), and I write and review books for O’Reilly and Frontend Dogma.
I love trying things, not only in web development and engineering management, but also in other areas like philosophy. Here on meiert.com I share some of my experiences and views. (I value you being critical, interpreting charitably, and giving feedback.)