Add new mixin for media query breakpoints
This commit is contained in:
parent
0e2e86a81e
commit
ced4c35dbd
2 changed files with 29 additions and 0 deletions
28
styles/mixins.scss
Normal file
28
styles/mixins.scss
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// use with @include
|
||||
@mixin breakpoint($breakpoint) {
|
||||
$phone-width: 430px;
|
||||
$phone-height: 850px;
|
||||
|
||||
$tablet-width: 1024px;
|
||||
$tablet-height: 1024px;
|
||||
|
||||
@if $breakpoint == tablet {
|
||||
// prettier-ignore
|
||||
@media only screen
|
||||
and (max-width: $tablet-width)
|
||||
and (max-height: $tablet-height)
|
||||
and (-webkit-min-device-pixel-ratio: 2) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
||||
@if $breakpoint == phone {
|
||||
// prettier-ignore
|
||||
@media only screen
|
||||
and (max-width: $phone-width)
|
||||
and (max-height: $phone-height)
|
||||
and (-webkit-min-device-pixel-ratio: 2) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
// @import 'include-media/dist/_include-media';
|
||||
@import 'mixins.scss';
|
||||
|
||||
// Breakpoints
|
||||
$breakpoints: (
|
||||
|
|
|
|||
Loading…
Reference in a new issue