Skip to content

Instantly share code, notes, and snippets.

@juanbrujo
Created April 10, 2015 13:49
Show Gist options
  • Save juanbrujo/d9a97ad8adc6298b705b to your computer and use it in GitHub Desktop.
Save juanbrujo/d9a97ad8adc6298b705b to your computer and use it in GitHub Desktop.
SCSS @media mixin
// The Mixin:
@mixin bp($type) {
@if $type == small {
@media (min-width: 24em) { @content; }
}
@else if $type == medium {
@media (min-width: 46.8em) { @content; }
}
@else if $type == large {
@media (min-width: 50em) { @content; }
}
}
// Use:
selector {
@include bp(small) {
}
@include bp(medium) {
}
@include bp(large) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment