Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback css not working #56

Closed
IschaGast opened this issue Jul 9, 2013 · 8 comments
Closed

Fallback css not working #56

IschaGast opened this issue Jul 9, 2013 · 8 comments

Comments

@IschaGast
Copy link

My fallback.css isn't working and I don't see why anymore.

This is my style.css

// **************************************************
//  _style.scss
// **************************************************

// --------------------------------------------------
//  Sass extensions
// --------------------------------------------------
@import "compass";
@import "breakpoint";

// --------------------------------------------------
//  Embedded files
// --------------------------------------------------
@import "generic/settings";
@import "generic/mixins";
@import "generic/reset";
@import "base/grid";
@import "base/fonts";
@import "base/global";
@import "base/icons";
@import "base/forms";

Inside settings there is this

// --------------------------------------------------
//  Breakpoints
// --------------------------------------------------
$mobile: max-width 620px;
$tablet: 35em;
$desktop: 56em;

My fallback scss looks like this

// Will not print media queries
$breakpoint-no-queries: true;

// Will print No Query Fallbacks
$breakpoint-no-query-fallbacks: true;

// --------------------------------------------------
//  Embedded files
// --------------------------------------------------
@import "style";

But in IE8 my fallback styles don't work and I don't know why.
When I look at the wiki my settings file should be like this

// --------------------------------------------------
//  Breakpoints
// --------------------------------------------------
$mobile: max-width 620px, 'no-query' true;
$tablet: 35em, 'no-query' true;
$desktop: 56em, 'no-query' true;

But when I do that my site only gets the mobile view.

In my files where I use the breakpoints it looks like this

%unit {
    padding: 0 10px;
    @include breakpoint($tablet) {
        float: left;
        &.unit-right {
            float: right;
        }
    }
}
@IschaGast
Copy link
Author

Now I also tried the code that's in the Wiki itself and that's also not working right now.

I tried this code:

Scss styles

Style.scss

$no-queries: 678px, 'no-query' true;

#foo {
  content: 'Basic Styling';
  @include breakpoint($no-queries) {
    content: 'No Media Queries';
  }
}

ie.scss

// Will not print media queries
$breakpoint-no-queries: true;
// Will print No Query Fallbacks
$breakpoint-no-query-fallbacks: true;

@import "style";

Generated styles

style.css

#foo {
    content:'Basic Styling'
}
@media (min-width: 678px) and (no-query: true) {
    #foo {
        content:'No Media Queries'
    }
}

ie.css

#foo {
    content:'Basic Styling'
}

I removed the .touch part of the code because it was giving an error into codekit
codekit

@felek000
Copy link

same problem any solution ??

@Snugug
Copy link
Member

Snugug commented Jan 30, 2014

Do you have the same problem with 2.4.x?

@benkutil
Copy link

@Snugug, I’m having a problem with fallbacks, but maybe I’m making an assumption on how no query fallbacks can be used.

If I specify my fallback as part of a variable, it works no problem.

SCSS

$m-l: 60em, 'no-query' '.lt-ie9';
body {
  @include breakpoint($m-l) {
      display: none;
  }
}

Rendered CSS

@media (min-width: 60em) {
  body {
    display: none;
  }
}

.lt-ie9 body {
  display: none;
}

Great!


Sometimes, I have a medium and a large media query, and the ruleset can be applied for both. This isn't always the case, so in my variable for the medium query, I don't specify the fallback, and instead try to do it inline within breakpoint's parameters.

SCSS

$m-m: 48em;
$m-l: 60em, 'no-query' '.lt-ie9';

body {
  @include breakpoint($m-m, 'no-query' '.lt-ie9') {
    display: block;
  }
}

Rendered CSS

@media (min-width: 48em) {
  body {
    display: block;
  }
}

"no-query"    ".lt-ie9"   body {
  display: block;
}

Here, I’d expect to get the no-query fallback, but am instead getting quoted strings in place of the selectors.

Is this not possible in Breakpoint? I didn't see it explicitly mentioned.

@Snugug
Copy link
Member

Snugug commented Mar 31, 2014

@benkutil In the future, if you have a different issue, even if it is related, please submit a new issue.

You can do one of the following: either wrap your call in parenthesis to make it one item (@include breakpoint(($m-m, 'no-query' '.lt-ie9')) {}) or you can drop the no-query as the 2nd argument for the Breakpoint mixin is already no-query (@include breakpoint($m-m, '.lt-ie9') {})

@benkutil
Copy link

Thanks @Snugug for the quick reply, sorry to hijack the thread!

@Snugug
Copy link
Member

Snugug commented Aug 11, 2014

Is the main issue still a problem with the latest version of Breakpoint?

@Snugug
Copy link
Member

Snugug commented Aug 23, 2014

Seeing no movement, closing this.

@Snugug Snugug closed this as completed Aug 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants