-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_util.scss
52 lines (43 loc) · 1.53 KB
/
_util.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
48
49
50
51
52
@mixin _support-value($value, $list) {
@if index($list, $value) == null {
@error "not support #{$value}. possible values #{$list}";
}
}
@mixin _only-support-int($value) {
@if type-of($value) != number or unit($value) != '' {
@error "not support #{$value} only int";
}
}
@mixin _fx-layout-align-main-axis($value) {
@include _support-value($value, (null, start, center, end, space-around, space-between, space-evenly));
@if $value != null {
$value: if($value == start or $value == end, flex-#{$value}, $value);
justify-content: $value;
}
}
@mixin _fx-layout-align-cross-axis($value) {
@include _support-value($value, (null, start, center, end, space-around, space-between, space-evenly, stretch));
@if $value != null {
$value: if($value == start or $value == end, flex-#{$value}, $value);
align-content: $value;
align-items: $value;
}
}
@mixin _fx-layout-gap($value, $direction) {
@if $value != null {
@include _support-value(unit($value), ('%', px, vh, vw));
@include _support-value($direction, (column, row, column-reverse, row-reverse));
$margin-direction: if($direction == column, bottom, null);
$margin-direction: if($direction == column-reverse, top, $margin-direction);
$margin-direction: if($direction == row-reverse, left, $margin-direction);
$margin-direction: if($direction == row, right, $margin-direction);
& > *:not(:last-child) {
margin-#{$margin-direction}: $value;
}
}
}
@mixin _fx-wrap($value) {
@if $value != null {
flex-wrap: $value;
}
}