For some time I have used a custom template.php function to load a stylesheet if it finds one with the name of the page in the theme folder which has worked decently well altho i have some issues with it bc many times that's to simple a rule.

often times if you like separating out stylesheets it's not too hard to do. if you have a custom content type, you can override that content type and put a stylesheet reference at the top. same with custom modules, same with custom views using the views module.

but let's say you theme a section of the site and want it all orange with graphics and all that mess, it encompasses blocks, content, views, custom content etc.

I'd love to have a rule that I set up to load a stylesheet or styles like css injector and I'd like it to be 5 compatible, such as

1. click new css rule
2. set up url paths like you do with block visibility
3. have a text box where you either put in the css directly or you put in a url to a css stylesheet in your theme folder
4. sort the rules in order to establish precendence
5. repeat steps for more css rules

So you could say newsroom/*, then say newsroom.css and it would load that stylesheet when it picked up that url.

Seems really easy to make such a module. Is there anything out there like that? If not I might make a module myself, seems really easy and would make your layouts much more flexible. Thoughts?

Comments

drupalninja99’s picture

=)

drupalninja99’s picture

http://jay.callicott.name/content/css-rules-project

Please let me know if something like this already exists. Basically it lets you add rules for loading CSS stylesheets (similar to the way you load blocks).

I would like to have a few people test it and give feedback. Anyone else interested in this module? I think it's pretty cool myself.