mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-25 17:03:52 +00:00
refactor: improve media query mixin
This commit is contained in:
parent
d4af0e0310
commit
df54fabaf5
1 changed files with 16 additions and 22 deletions
|
|
@ -1,26 +1,20 @@
|
|||
@mixin mq($size, $type: min) {
|
||||
@if $size == 'xxs' {
|
||||
@media screen and ($type + -width: $layout-xxs) {
|
||||
@content;
|
||||
}
|
||||
} @else if $size == 'xs' {
|
||||
@media screen and ($type + -width: $layout-xs) {
|
||||
@content;
|
||||
}
|
||||
} @else if $size == 'sm' {
|
||||
@media screen and ($type + -width: $layout-sm) {
|
||||
@content;
|
||||
}
|
||||
} @else if $size == 'md' {
|
||||
@media screen and ($type + -width: $layout-md) {
|
||||
@content;
|
||||
}
|
||||
} @else if $size == 'lg' {
|
||||
@media screen and ($type + -width: $layout-lg) {
|
||||
@content;
|
||||
}
|
||||
} @else if $size == 'component' {
|
||||
@media screen and ($type + -width: $component-max-width) {
|
||||
$f: 0;
|
||||
@if ($type == max) {
|
||||
$f: -1;
|
||||
}
|
||||
|
||||
$width: map-get((
|
||||
'xxs' : $layout-xxs,
|
||||
'xs' : $layout-xs,
|
||||
'sm' : $layout-sm,
|
||||
'md' : $layout-md,
|
||||
'lg' : $layout-lg,
|
||||
'component' : $component-max-width,
|
||||
), $size);
|
||||
|
||||
@if ($width) {
|
||||
@media screen and ($type + -width: $width + $f) {
|
||||
@content;
|
||||
}
|
||||
} @else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue