Jens Oliver Meiert

The Stupidest Style Sheet Name Ever

Post from March 25, 2009 (↻ July 16, 2017), filed under .

This and many other posts are also available as a pretty, well-behaved e-book: On Web Development.

This might irritate a few people, but 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 some 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 the Author

Jens Oliver Meiert, photo of July 27, 2015.

Jens Oliver Meiert is a developer (O’Reilly, W3C, ex-Google) and philosopher. He experiments with art and adventure. Here on meiert.com he shares and generalizes and exaggerates some of his thoughts and experiences.

There’s more Jens in the archives and at Amazon. If you have any questions or concerns (or recommendations) about what he writes, leave a comment or a message.

Comments (Closed)

  1. On March 25, 2009, 23:45 CET, Neal G said:

    I always name mine after the media type I apply to it, which is almost always “all” so I therefore name my master style sheet all.css, which I include @media type for screen, print, handheld, aural.

  2. On March 26, 2009, 0:26 CET, Louis said:

    I think that style.css is perfectly fine for personnal websites like this very blog for example. Wise people know that the HTTP requests are the evil, so they try to concatenate to the maximum.

    I used to have one main style.css file and it was the perfect fit. Now I serve my css inline as I’ve calculated that it’s even faster — and maintenance is not a problem for a personnal weblog.

  3. On March 26, 2009, 1:42 CET, Robert said:

    Jens, is my feeling of this being a rather banal entry not on par with your usual level of content quality a singularity of myself, or do you feel the same?

    File names, OMG. What level of abstraction have we left behind the last decade?

  4. On March 26, 2009, 8:29 CET, Jens Oliver Meiert said:

    Neal, interesting… I wanted to ask what you’ll do when you, say, go from screen to screen, projection (a legit concern I think), but “all.css” appears to be immune against that.

    Louis, I typically like the idea of separating maintainability and performance. What you’re saying is better just have one style sheet to save HTTP requests, right? There might be several reasons why to split style sheets, yet having several of them doesn’t have to mean that you’re serving them separately.

    Robert, I very much appreciate your concern, I really do 😊 As I wrote, this looks like a trivial (at least “not difficult”) topic, and several web developers might actually never run into any issues, but certain file names (like “style.css”, but also “screen.css”) mean a higher chance of avoidable document changes—aka maintenance problems. Just stay with me, it should get a bit clearer soon 😊

  5. On March 26, 2009, 9:14 CET, Kroc Camen said:

    I mod_rewrite mine to http://camendesign.com/design/ 😛

  6. On March 27, 2009, 18:45 CET, Louis said:

    @Jens: for a small sized weblog, I find the all-in-one-css-file approach very convenient.

  7. On April 23, 2009, 13:17 CEST, yomi said:

    u are absoluetly right

  8. On June 14, 2009, 2:30 CEST, Olivier said:

    “My experience makes me guess that more than 60 % of web sites actually use more than one style sheet.” doesn’t mean anything. As if experience could make you guess something subjective.

  9. On June 14, 2009, 3:42 CEST, Jens Oliver Meiert said:

    Olivier, point taken, this is poorly phrased. The observation correlates with the data I gathered analyzing CSS use of the Alexa Top 10; for the Alexa Top 10, it’s currently 50%.

Read More

Have a look at the most popular posts, possibly including:

Or maybe say hi on Twitter, Google+, or LinkedIn?

Looking for a way to comment? Comments have been disabled, unfortunately.

Flattr? Found a mistake? Email me, jens@meiert.com.

You are here: HomeArchive2009 → The Stupidest Style Sheet Name Ever

Last update: July 16, 2017.

“If there is any secret, it is missed by seeking.”