I've searched and read lots of stuff, but I can't get a straight, layman's answer.

I'm *not* a themer. I've downloaded a theme, and there are lots of styles missing.
For instance, the styles for .book_printer a and .book_add_child a

Rather than add these styles to style.css, I want to have a separate stylesheet called
custom.css, which I've created and placed in the theme folder. However, I don't know
how to declare it in D6?

Thanks.

Comments

heytrish’s picture

Create your stylesheet and place it in the theme directory you are currently using.

Edit or create template.php and insert the following:

drupal_add_css('your_STYLESHEET');

RE: http://api.drupal.org/api/function/drupal_add_css/6

-Anti-’s picture

Thanks for the reply.

Yes, that page you linked to was one of the many I referred to when I said I couldn't find a layman's answer.
If you could help me a little more, I'd be very grateful:

It seems to me that in template.php, there are nothing but functions.
So putting exactly: drupal_add_css('custom.css'); probably won't do anything or cause an error?

So do I need to put something like:

<?php
function drupal_add_css(custom.css) { return $css; }
?>

Doesn't any of this stuff matter?
$path = NULL, $type = 'module', $media = 'all', $preprocess = TRUE

And also what do I do if I want to add another additional stylesheet in the future?

Thanks so much for any further clarification.

silverwing’s picture

can you just add <style> @import "<?php print $base_path ?>/themes/themename/custom.css"; </style>

to the head of page.tpl.php?

~silverwing
_____________________________________________
Land of Midnight | MisguidedThoughts | showcaseCMS

-Anti-’s picture

> can you just add

I don't know... can I? ;)

Is there any advantage of that, over using the drupal_add_css method?

silverwing’s picture

Yes you can. :)

I don't know.

~silverwing - not a php geek

_____________________________________________
Land of Midnight | MisguidedThoughts | showcaseCMS

heytrish’s picture

Append to template.php (before the php end tag, if any)


drupal_add_css(custom.css);

// OR

drupal_add_css(path_to_theme().'/custom.css');


The advantage to appending the template.php file is that you are centrally adding css files to your theme. So if there any filename changes or locations, you change it once instead of many times. Oppose to adding it to page.tpl.php, and if you create another page-type.tpl.php, you will have to add it there too.

Add additional files (including javascript)

drupal_add_css(path_to_theme().'/menu.css');
drupal_add_css(path_to_theme().'/submenu.css');
drupal_add_js(path_to_theme().'/primarynav.js');

Another way to add css, is to edit the .info file.

stylesheets[all][] = custom.css
-Anti-’s picture

Thank you both for your help.
I'm sure this thread will be useful for noobs.

fehin’s picture

subscribing...