Last active
August 29, 2015 14:01
-
-
Save starryeyez024/3876bce41b061df2369e to your computer and use it in GitHub Desktop.
How to use Breakpoints effectively
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<div class="test"> | |
Test test test | |
</div> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** Breakpoints *** */ | |
@media (min-width: 771px) { | |
body .test { | |
background: blue; | |
} | |
} | |
@media (max-width: 770px) { | |
body .test { | |
border: solid 2px pink; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<div class="test"> | |
Test test test | |
</div> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.3.7) | |
// Compass (v1.0.0.alpha.18) | |
// Breakpoint (v2.4.2) | |
// Singularity.gs (v1.2.1) | |
// ---- | |
@import "breakpoint" | |
@import "compass" | |
@import "singularitygs" | |
/**** Breakpoints ****/ | |
// For use with max-width only: | |
// +breakpoint(max-width: $tab-l) | |
$phone-p: 320px | |
$phone-l: 480px | |
$tab-p: 640px | |
$tab-l: 770px | |
$desk: 960px | |
// For use with min-width (default breakpoint mixin) | |
// +breakpoint($desktop) | |
$smartphone-portrait: ($phone-p + 1px) | |
$smartphone-landscape: ($phone-l + 1px) | |
$tablet-portrait: ($tab-p + 1px) | |
$tablet-landscape: ($tab-l + 1px) | |
$desktop: ($desk + 1px) , 'no-query' '.lt-ie9' | |
// extras | |
$print: 'not screen' | |
$hidpi: min-resolution 143dpi | |
$mobile: max-width $desk | |
//$breakpoint-to-ems: true | |
//*** EXAMPLE SASS CODE ****/ | |
.test | |
padding: 10px | |
+breakpoint($tablet-landscape) | |
background: blue | |
color: white | |
+breakpoint(max-width $tab-l) | |
border: solid 2px pink |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** Breakpoints *** */ | |
.test { | |
padding: 10px; | |
} | |
@media (min-width: 771px) { | |
.test { | |
background: blue; | |
color: white; | |
} | |
} | |
@media (max-width: 770px) { | |
.test { | |
border: solid 2px pink; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<div class="test"> | |
Test test test | |
</div> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment