Useful scss
@mixins for easy integration of Bootstrap 3 breakpoints
With Bootstrap 4 we got new super-useful @mixins for @media breakpoints such as
media-breakpoint-up
,media-breakpoint-down
, etc. So, I've created similar @mixins that can be used in your projects based on Bootstrap 3.
Include mixin-breakpoints.scss
in your project and then use the following @mixins.
body {
@include media-breakpoint-up(md) {
background-color: red;
}
}
@media (min-width: 992px) {
body {
background-color: red;
}
}
body {
@include media-breakpoint-down(lg) {
background-color: green;
}
}
@media (max-width: 1199px) {
body {
background-color: green;
}
}