This repository has been archived by the owner on Jan 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_mixins.scss
47 lines (43 loc) · 1.63 KB
/
_mixins.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// ============================================================================================= //
// MIXINS //
// ============================================================================================= //
@use "sass:string";
@use "./functions";
@mixin breakpoint($min-width: false, $max-width: false, $root-selector: false) {
@if $root-selector and (string.slice($root-selector, 1, 1) != ".") and (string.slice($root-selector, 1, 1) != "#") {
@error "The \"#{$root-selector}\" selector need to be ID or class.";
}
@if $min-width {
@if $max-width {
@media all and (min-width: functions.set-value($min-width)) and (max-width: functions.set-value-has-strict($max-width)) {
@if $root-selector {
#{$root-selector} & {
@content;
}
} @else {
@content;
}
}
} @else {
@media all and (min-width: functions.set-value($min-width)) {
@if $root-selector {
#{$root-selector} & {
@content;
}
} @else {
@content;
}
}
}
} @else if $max-width {
@media all and (max-width: functions.set-value-has-strict($max-width)) {
@if $root-selector {
#{$root-selector} & {
@content;
}
} @else {
@content;
}
}
}
}