style.css media="all" causing conflicts with print.css

When the $stylesheets variable is output in my template, it contains a reference to my theme's stylesheet with a media="all" that is conflicting with the print.css.  I did a lot of searching and found several people who proposed different solutions

  • move everything from style.css to a new custom stylesheet.  style.css is empty, and include your new stylesheet with the correct media type
  • Do a string replace with your stylesheets variable.

I'm glad I kept looking!  Look into your theme's info file, you can change the media for any of your stylesheets there.
Solution:
Modify yourtheme.info
From:  stylesheets[all][] = style.css
To:  stylesheets[screen][] = style.css

Comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options