A simple Media Query Library for Sass to go. (Gugus: Swiss German for «peeck a boo»)
These queries are an adaption of David Walshes Media Query Mixins
Import ins SCSS with: @import "../../node_modules/gugus-media-queries/gugus-media-queries";
There are Size Variables to easily change the mixins. These Sizes are based on Bootstrap 4
Size | px | Example Selector | Example Selector (downwards) |
---|---|---|---|
Extra small | ≥320px | @include xsUp { … } |
@include xsDown { … } |
Small | ≥576px | @include smUp { … } |
@include smDown { … } |
Medium | ≥768px | @include mdUp { … } |
@include mdDown { … } |
Large | ≥992px | @include lgUp { … } |
@include lgDown { … } |
Extra large | ≥1200px | @include xlUp { … } |
@include XlDown { … } |
@include smUp {
body {
background: red;
}
};
@media (min-width: 576px) {
body {
background: red;
}
};
There are visibility Extends as well:
.hiddenLgDown { @include smDown { display: none; } }
This would hide an element on Lg size and below.
You can now add Visibility Classes as a extend
, as a Mixin
or as a class directly in your HTML
:
.yourThing { @extend %hiddenSmDown; }
.yourThing { @include hiddenSmDown; }
<li class="hiddenSmUp">Gugus Dada</li>