Skip to content

Instantly share code, notes, and snippets.

@liquorice
Created September 23, 2013 01:53
Show Gist options
  • Save liquorice/6665641 to your computer and use it in GitHub Desktop.
Save liquorice/6665641 to your computer and use it in GitHub Desktop.
SASS breakpoints mixin
@mixin breakpoint($points) {
@if index($points, large) {
@media screen and (min-width: 1000) { @content; }
html.ie-large & { @content; }
}
@if index($points, medium) {
@media screen and (max-width: 999) and (min-width: 600) { @content; }
}
@if index($points, small) {
@media screen and (max-width: 599) { @content; }
}
}
<!DOCTYPE html>
<!--[if lte IE 8]>
<html class="ie-large">
<![endif]-->
<!--[if gt IE 8]> -->
<html>
<!-- <![endif]-->
h1 {
@include breakpoint(large, medium) {
font-size: 32px;
}
@include breakpoint(small) {
font-size: 24px;
}
}
@liquorice
Copy link
Author

Borrowed heavily from @makenosound

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment