I know that I can add additional css files using:

stylesheets[all][] = css/my-other-file.css

I'd like to dd a print.css file to override the default. How would I go about doing that? Using the above method just adds the styles in print.css to everything (not just a printed version).

Comments

jeremycaldwell’s picture

Status: Active » Fixed

Hi there, you can get a stylesheet to load for printing only like so:

stylesheets[print][] = css/my-other-file.css

Hope that helps!

dddbbb’s picture

That's great, thanks.

Will this completely override the default print.css or will it just be loaded after?

jeremycaldwell’s picture

Fusion Core doesn't come with a print.css file so whatever you add to your theme should be it.

dddbbb’s picture

I meant Drupal core, not Fusion core.

jeremycaldwell’s picture

Oh, well Drupal core doesn't come with a default print stylesheet either. Typically a print stylesheet is defined by your theme and the default is for one to not be included and then you add one if needed.

dddbbb’s picture

What about misc/print.css? Isn't that core?

jeremycaldwell’s picture

True, I wouldn't worry about it as it just sets so very basic elements and you can override them in your theme's print.css.

dddbbb’s picture

Yeah, but that's what I'm asking...

Does one file override another or are they added together like when you link to multiple external stylesheets in a page?

jeremycaldwell’s picture

They are added together. There may be a way to remove the default Drupal print.css by unsetting it in your theme's template.php but I haven't done that before. If you look at the Drupal print.css you will see it's just a few lines of code which you can easily copy/paste into your theme's print.css file and overwrite them there.

dddbbb’s picture

Thanks. That's actually the result I was hoping for - the default print.css makes a nice start.

Status: Fixed » Closed (fixed)
Issue tags: -print

Automatically closed -- issue fixed for 2 weeks with no activity.