Skip to content

Instantly share code, notes, and snippets.

@starryeyez024
Last active January 2, 2016 13:19
Show Gist options
  • Save starryeyez024/8308754 to your computer and use it in GitHub Desktop.
Save starryeyez024/8308754 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
.foo {
background: grey;
}
@media (min-width: 320px) {
.foo {
background: blue;
}
}
.lt-ie9 .foo {
background: blue;
}
@media (min-width: 769px) {
.foo {
background: red;
}
}
.lt-ie9 .foo {
background: red;
}
/*Then this max-width implementation is generally **not**
* what you want to do, but should you need to, you may use
* the breakpoint mixin with the variable that correlates
* with the number only:
*/
.exception-to-the-rule {
width: 50%;
}
@media (max-width: 444px) {
.exception-to-the-rule {
/* applies only to devices less than 444px */
width: 100%;
}
}
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// Breakpoint (v2.2.0)
// ----
@import "breakpoint"
$phone-p: 320px
$phone-l: 480px
$tab-p: 444px
$tab-l: 769px
$desk: 960px
/////////////////////////////////////////////////
// No Query Fallbacks https://github.com/Team-Sass/breakpoint/wiki/No-Query-Fallbacks
$breakpoint-no-query-fallbacks: true
$smartphone-portrait: $phone-p, 'no-query' '.lt-ie9'
$smartphone-landscape: $phone-l, 'no-query' '.lt-ie9'
$tablet-portrait: $tab-p, 'no-query' '.lt-ie9'
$tablet-landscape: $tab-l, 'no-query' '.lt-ie9'
$desktop: $desk, 'no-query' '.lt-ie9'
/////////////////////////////////////////////////
.foo
background: gray
+breakpoint($smartphone-portrait)
background: blue
+breakpoint($tablet-landscape)
background: red
/*Then this max-width implementation is generally **not**
* what you want to do, but should you need to, you may use
* the breakpoint mixin with the variable that correlates
* with the number only:
*/
.exception-to-the-rule
width: 50%
+breakpoint(max-width $tab-p)
/* applies only to devices less than 444px */
width: 100%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment