Skip to content

Instantly share code, notes, and snippets.

@faustienf
Created April 11, 2018 10:15
Show Gist options
  • Save faustienf/8d63bd25f829d7f4f21bec784620e2d9 to your computer and use it in GitHub Desktop.
Save faustienf/8d63bd25f829d7f4f21bec784620e2d9 to your computer and use it in GitHub Desktop.
Simple breakpoint mixin
// 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