Posted by arnemaine on August 31, 2011 at 10:30pm
OK, so here's my question: what is the best way to include print media styles in an Omega XHTML sub-theme? I'm unclear about how to add new style sheets in an Omega sub-theme, as I'm still having a hard time understanding the .info file, which looks quite different from the .info files I'm used to when I use Fusion in Drupal 6.
I'm also wondering if print media might be a cool thing to include in the template structure or UI of some future version of Omega. Just a thought.
Comments
In your
In your .info:
css[print.css][name] = 'A CSS for print'css[print.css][description] = 'This file holds all the custom print CSS of your theme.'
css[print.css][options][weight] = '10'
Thanks!
Thanks for the quick reply. Adding this into the .info file is starting to makes sense, once I think about the weight option used for Omega.
Question: In the line
css[print.css][name] = 'A CSS for print'I would, for example, write:css[print.css][my_stylesheet_name] = 'My description of what the CSS file is for'So the
[print.css]remains the same, but then labels and my description as I see fit? Hope my question makes sense. Thanks!Yeah, but once you get it,
Yeah, but once you get it, you'll find it quite easy. You can continue to add CSS files using this method to cover other things too.
Please see edit to my response
Please see edit to my response. I think we crossed forum paths. :)
Or this?
Or this?
css[print.css][name] = 'my_print_file_name.css'css[print.css][description] = 'This file holds all of the custom print CSS for my theme.'
css[print.css][options][weight] = '10'
Sorry, being dense here…
I'm too tired to make sense tonight, sorry if I'm confusing things.
Looking at the .info file it looks like I just put in the name of the CSS file in the first brackets
[print.css]and then label it whatever I want after the=on the same line. Then add whatever description I want on the next line, and whatever weight I want on the last line.Is this correct, as far as how to add any of my own CSS files to the .info file?
Also I assume that you would want the print file to load last? So if your global.css file was weighted 10, would you want to use a higher number? I've never done any print media CSS before, so not sure how it integrates with the other style weights.
Yes, you need to add it like
Yes, you need to add it like you did here:
css[print.css][name] = 'my_print_file_name.css'css[print.css][description] = 'This file holds all of the custom print CSS for my theme.'
css[print.css][options][weight] = '10'
And, as far as I know, you should weight it lower so that it loads later. I'm not sure how much that matters though really.
Specify media?
Shouldn't it be
css[print.css][name] = Your custom print stylescss[print.css][description] = This file holds all the custom print CSS of your theme.
css[print.css][options][weight] = 10
css[print.css][options][media] = print
So it just gets used for just for print? Doesn't it default to "all"?
You are correct. Also, you
You are correct. Also, you need to go to the Settings, Toggle Styles tab for the theme and enable the newly added stylesheet.
Orlando, FL Web Developer | http://www.garethsprice.com/