I've used Omega4 theme a lot lately, and I believe it has a function to automatically include any "no-query.css" files in my theme, wrapped in conditional comments for IE8 and below.

I'm using Zen 7.x-5.4 on some client sites, and don't know how to duplicate this 'feature'. I know there a lot of ways to handle Breakpoint and no-query, but I've always liked the separate file method.

Do I have to manually call each of these no-query.css files in my .info file? Is there a function I can use? Has anyone else dealt with this issue?

Comments

davidneedham’s picture

If you're using compass / sass, it should be pretty simple. If your no-query.css is a scss file to be aggregated into the compiled styles.css, then you should be able to use the class .lt-ie9 wrapping everything in the no-query.scss file.

.lt-ie9{

[your IE8 and below css here]

}

This would generate just the one css file, even if you add multiple "conditional" stylesheets.

minneapolisdan’s picture

Thanks David. The no-query.css is auto-generated by Breakpoint. So in the following example, this is all the code in my no-query.scss file.

$breakpoint-no-queries: true;
$breakpoint-no-query-fallbacks: true;

// Re-render everything from styles.scss but without media queries.
@import "styles";

That all works fine, by the way. I'm just wondering how to best call this no-query.css file, ONLY for IE8 and below. I may just work on a work-around, similar to what you suggested. I just liked how it worked in Omega4, and wondering if anyone had a similar solution for Zen 7x-5.

johnalbin’s picture

Status: Active » Fixed

I do this technique all the time using the Conditional Stylesheets module. https://www.drupal.org/project/conditional_styles 7.x-2.2 of that module was released specifically to add the "load this stylesheet for IE8 and this other one for everyone else" feature.

I prefer to keep these kinds of solutions modular rather than putting everything into Zen.

Status: Fixed » Closed (fixed)

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