@mixin respond_within($min-breakpoint: null, $max-breakpoint: null, $media: screen) {
@if $min-breakpoint != null {
@if $max-breakpoint != null {
//Both breakpoints are passed.
@media #{$media} and (min-width: $min-breakpoint) and (max-width: $max-breakpoint) {
@content;
}
} @else {
@media #{$media} and (min-width: $min-breakpoint) {
@content;
}
}
} @else if $max-breakpoint != null {
// Only a max value is present.
@media #{$media} and (max-width: $max-breakpoint) {
@content;
}
} @else { // Since both values are null just output the content
@content;
}
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.