To make Notes Blog Core a bit easier to work with, I’m considering splitting up the stylesheet in several files, instead of having everything in style.css. This might not matter so much right now as the stylesheet isn’t overly complicated nor long, but when adding support for plugins and new features it might be a good idea.
What better way to decide what to do than to ask you guys?
The idea is that style.css, which is a necessary file, will contain the bare minimum. This means that the file will contain the theme header at the top, and then import additional stylesheets.
Here is the proposed setup:
- style.css just imports other stylesheets and contains the CSS resets.
- layout.css contains the main layout (positioning and such) as well as general design.
- typography.css is all about the text, including link colors.
Yay or nay? Speak your mind in the comments to pitch in on my decision!
Smashing WordPress: Beyond the Blog is now available in its second edition. The book is revised and updated, sporting even more Notes Blog galore, all in full color.
My latest book is called Smashing WordPress Themes: Making WordPress Beautiful and is all about theming. The book is available now from your favorite online retailer (or physical bookstore).
It’s a common practice to break up code into small files. And it’s great during development.
However when it comes to a website in production having several stylesheets decrease performance. When development is finished styles should always be combined and minimized.
If this means loading in styles that might not be needed i.e. overloading extra styles statistics shows that it usually doesn’t cost as much as that extra request. And if the extra styles is needed on another of the pages on your site you still win. By including everything in the one stylesheet you save even more on performance since the styles are now cached and doesn’t need to be requested again when the user navigate his way around your site.
Tried my best to make my point clear. Hope it helps some with your decision.
I’m trying to create a child theme to Notes Blog Core for the website I’m building, and not only would I welcome separate CSS files for the various distinctions you mention, I’d welcome a home.php file (or a couple of options), plus the other .php files I either have to create from scratch or modify index.php to accommodate.
Because of those two reasons (CSS in a single file, and especially because the index.php was designed to handle every instance) I’d have to rate this as merely adequate: extemely helpful in terms of getting started, but far more difficult to expand upon, given the theme’s reliance on that single CSS and, especially, that single index.php file.
I’d go with a single style sheet and careful, plentiful commenting.