Min-width
// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) {
}
// Medium devices (tablets, 768px and up)
@media (min-width: 768px) {
}
// Large devices (desktops, 992px and up)
@media (min-width: 992px) {
}
// X-Large devices (large desktops, 1200px and up)
@media (min-width: 1200px) {
}
// XX-Large devices (larger desktops, 1400px and up)
@media (min-width: 1400px) {
}
// Source mixins
// No media query necessary for xs breakpoint as it's effectively
@media (min-width: 0) {
}
@include media-breakpoint-up(sm) {
}
@include media-breakpoint-up(md) {
}
@include media-breakpoint-up(lg) {
}
@include media-breakpoint-up(xl) {
}
@include media-breakpoint-up(xxl) {
}
// Usage
// Example: Hide starting at `min-width: 0`, and then show at the `sm` breakpoint
.custom-class {
display: none;
}
@include media-breakpoint-up(sm) {
.custom-class {
display: block;
}
}
Max-width
// X-Small devices (portrait phones, less than 576px)
@media (max-width: 575.98px) {
}
// Small devices (landscape phones, less than 768px)
@media (max-width: 767.98px) {
}
// Medium devices (tablets, less than 992px)
@media (max-width: 991.98px) {
}
// Large devices (desktops, less than 1200px)
@media (max-width: 1199.98px) {
}
// X-Large devices (large desktops, less than 1400px)
@media (max-width: 1399.98px) {
}
// XX-Large devices (larger desktops)
// No media query since the xxl breakpoint has no upper bound on its width
// No media query necessary for xs breakpoint as it's effectively
@media (max-width: 0) {
}
@include media-breakpoint-down(sm) {
}
@include media-breakpoint-down(md) {
}
@include media-breakpoint-down(lg) {
}
@include media-breakpoint-down(xl) {
}
@include media-breakpoint-down(xxl) {
}
// Example: Style from medium breakpoint and down
@include media-breakpoint-down(md) {
.custom-class {
display: block;
}
}
Single breakpoint
@include media-breakpoint-only(xs) {
}
@include media-breakpoint-only(sm) {
}
@include media-breakpoint-only(md) {
}
@media (min-width: 768px) and (max-width: 991.98px) {
}
@include media-breakpoint-only(lg) {
}
@include media-breakpoint-only(xl) {
}
@include media-breakpoint-only(xxl) {
}
Between breakpoints
@include media-breakpoint-between(md, xl) {
}
@media (min-width: 768px) and (max-width: 1199.98px) {
}