Created
April 11, 2018 10:15
-
-
Save faustienf/8d63bd25f829d7f4f21bec784620e2d9 to your computer and use it in GitHub Desktop.
Simple breakpoint mixin
This file contains 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 from bootstrap 4 | |
$grid-breakpoints: ( | |
xs: 0, | |
sm: 576px, | |
md: 768px, | |
lg: 992px, | |
xl: 1200px | |
) !default; | |
@mixin breakpoint($point) { | |
@each $key, $value in $grid-breakpoints { | |
@if $key == $point { | |
@media (min-width: $value) { | |
@content; | |
} | |
} | |
} | |
} | |
// usage | |
.some-text { | |
font-size: 18px; | |
@include breakpoint(sm) { | |
font-size: 14px; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment