As far as the extension would be concerned, it would only involve using a system (Minify was an example) that would compress and compile all style sheets included in $this->stylesheets into one file before serving it to the browser.
The rest was just talking about the implications. Aside from the obvious benefits of having one compressed style sheet instead of several separate ones, it would allow a developer to maintain a bunch of smaller CSS files for their project, keeping them modular and more manageable. So in addition to having a separate .tpl file for each feature of my project, it could also now have an accompanying CSS file with the rules to display it. So maybe I'd have a news.css, events.css, catalog.css. And I could do so without worrying about the implications of having 20 or so CSS file includes in my page.
Inside those files, I would have a "skeleton" of rules set up (I would manually create this -- the extension wouldn't do it) that I could just fill in to control display, i.e.
Code:
/* inside news.css */
#news {
}
#news .date {
}
#news .headline {
}
/* etc. etc. */
Depending on the project, I would just drop in the CSS files I need and fill in the "skeleton". I think this could streamline workflow a bit, but I can't say I've actually tried this out.
Maybe this should be a separate topic, but then at the end I mentioned the possible usefulness of an extension that is VERY similar to the Style Sheets module, but for JavaScript (and maybe called Behaviors). It would allow a user to add/edit/manage .js files for any custom scripts they want to include in their project. It wouldn't need the advanced editing options of the Style Sheets module -- editing would just open a code editor. But it would also incorporate the idea above so all these .js snippets would be compiled into one before serving.
Bookmarks