In an omega subtheme, is there a "Right Way" to add another CSS file? In my case, I want to add a CSS file for iphone retina display...

<!-- For Retina displays -->
<link rel="stylesheet" media="only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (min-device-pixel-ratio: 1.5)" href="css/2x.css">

...I can probably hack this in any number of ways, but just want to check here first for a proper mothod.

Thanks.

Comments

kruser’s picture

Version: 7.x-3.0-rc5 » 7.x-3.0
cellar door’s picture

I'd go about adding it via the Conditional Stylesheets Module or by adding it to your tpl files directly. Not sure there is an official way yet to add a conditional stylesheet through the .info.

danillonunes’s picture

Tried to hack the grid layouts array from the sub theme and doesn't work. :(

But anyway, I think you can add a CSS with the required media query with the code:

css[2x.css][name] = Retina
css[2x.css][description] = Retina display styles.
css[2x.css][options][media] = 'only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (min-device-pixel-ratio: 1.5)'

In your .info file (and then enable it in your theme settings).

Also, see drupal_add_css() for a list of options you can use.

kruser’s picture

thanks I'll give that a shot. I didn't know about the "css[2x.css][options][media]" variable.