Conditional stylesheets always sets media to "all" in rendered code. This is because the media option is not set in the module.

conditional_styles_preprocess_html -> drupal_add_css should have added the media option like this:

'media' => $media,

I will try and make a patch for this, but I'm not the best PHP developer in the world..

Comments

raekjaer’s picture

Patch adding media support in conditional stylesheets module.

raekjaer’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, conditional_styles-missing_media_option-1637306.patch, failed testing.

raekjaer’s picture

Hm, I can't imagine what I am doing wrong here. The patch passes testing on my local (clean) D7 build.

kris_mcl’s picture

Thanks raekjaer, I manually applied the code change in this patch and it looks like it's working very nicely for me. I'm using respond.js as a media query polyfill for IE < 9 and this patch allows the following media query to work perfectly.

stylesheets-conditional[lt IE 9][(min-width: 768px)][] = css/ie.css

I'm afraid I can't tell you why it failed testing either, it looks fine to me.

astonvictor’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

I'm closing it because the issue was created a long time ago without any further steps.

if you still need it then raise a new one.
thanks