I'm cleaning up my big crazy style sheets (possibly pertinent to a future question) and I'm wondering the best way to add custom CSS to a specific node or page.
In particular, my work site's home page is a Panel Page and it has a bunch of different styling. Right now the CSS is just included with the main theme style sheet.
Is there a way to say, "if this is node Foo, then add foo.css"? Is CSS Injector what I'm looking for?
I might be interested in generalizing this to other nodes/sections/etc, but at the moment I just want to handle this one item.
What I ended up doing.
I'm using a Zen subtheme, and discovered in actually reading through template.php that there's some commented out code for including conditional style sheets. Code below did exactly what I needed:
if (drupal_is_front_page()) {
drupal_add_css(path_to_theme() . "/foo.css", 'theme','all');
}
(Line 80 in a stock Zen template.php file, FWIW.)
page--front.tpl.php
andpage.tpl.php
– M a m a D Aug 13 '14 at 15:17