Skip to content

Instantly share code, notes, and snippets.

@djom202
Created January 8, 2016 13:53
Show Gist options
  • Select an option

  • Save djom202/4612e71146202b7033be to your computer and use it in GitHub Desktop.

Select an option

Save djom202/4612e71146202b7033be to your computer and use it in GitHub Desktop.
Create breakpoints to scss
/* BREAKPOINTS */
$break-big: "screen and (min-width:1660px)";
$break-large: ""; // Default
$break-medium: "screen and (min-width:461px) and (max-width:768px)";
$break-small: "screen and (max-width:460px)";
$break-smaller: "screen and (max-width:768px)";
/* MINIX */
@mixin respond-to($media, $pixeles:"") {
@if $media==big {
@media #{$break-big} {
@content;
}
}
@else if $media==medium {
@media #{$break-medium} {
@content;
}
}
@else if $media==small {
@media #{$break-small} {
@content;
}
}
@else if $media==smaller {
@media #{$break-smaller} {
@content;
}
}
@else if $media==px {
@media screen and (max-width: $pixeles) {
@content;
}
}
@else if $media==custom {
@media screen and ($pixeles) {
@content;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment