oo-loop 0.5.1 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/loop.css +221 -655
- package/dist/loop.min.css +1 -1
- package/package.json +5 -4
- package/scss/_loop.scss +23 -27
- package/scss/_variables.scss +7 -3
- package/scss/base/_base.scss +11 -19
- package/scss/base/_type.scss +27 -63
- package/scss/components/_button.scss +56 -84
- package/scss/components/_columns.scss +69 -89
- package/scss/components/_form.scss +5 -7
- package/scss/components/_grid.scss +50 -62
- package/scss/components/form/_checkbox.scss +33 -41
- package/scss/components/form/_input.scss +12 -74
- package/scss/components/form/_mixin.scss +47 -0
- package/scss/components/form/_radio.scss +27 -34
- package/scss/components/form/_select.scss +38 -46
- package/scss/components/form/_toggle.scss +21 -30
- package/scss/functions/_array.scss +13 -9
- package/scss/functions/_empty.scss +7 -4
- package/scss/functions/_index.scss +7 -0
- package/scss/functions/_map.scss +4 -2
- package/scss/functions/_replace.scss +7 -4
- package/scss/functions/_split.scss +10 -6
- package/scss/functions/_type.scss +8 -6
- package/scss/mixins/_breakpoint.scss +12 -22
- package/scss/mixins/_loop.scss +21 -19
- package/scss/utilities/_color.scss +9 -18
- package/scss/utilities/_container.scss +9 -10
- package/scss/utilities/_float.scss +7 -11
- package/scss/utilities/_list.scss +9 -14
- package/scss/utilities/_spacing.scss +29 -40
- package/scss/utilities/_text.scss +19 -64
- package/scss/utilities/_visibility.scss +10 -9
- package/scss/utilities/_wrapper.scss +5 -10
- package/scss/base/_all.scss +0 -9
- package/scss/functions/_all.scss +0 -9
- package/scss/mixins/_all.scss +0 -7
|
@@ -1,52 +1,44 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../variables' as v;
|
|
3
|
+
@use '../../functions' as fn;
|
|
4
|
+
@use 'mixin' as m;
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* Select
|
|
3
8
|
*/
|
|
4
9
|
|
|
5
|
-
$select-size: 10px !default;
|
|
6
|
-
$select-weight: 2px !default;
|
|
7
|
-
$select-color: $input-color !default;
|
|
8
|
-
$select-bgcolor: $input-bgcolor !default;
|
|
9
|
-
|
|
10
|
-
$select-themes: (
|
|
11
|
-
// 'plain' : (
|
|
12
|
-
// 'size' : $select-size,
|
|
13
|
-
// 'color': $select-bgcolor,
|
|
14
|
-
// 'bgcolor': $input-border-color,
|
|
15
|
-
// )
|
|
16
|
-
) !default;
|
|
17
|
-
|
|
18
10
|
@mixin selectTheme($theme) {
|
|
19
|
-
@if map
|
|
20
|
-
&::before { width: (map
|
|
11
|
+
@if map.has-key($theme, 'size') {
|
|
12
|
+
&::before { width: (map.get($theme, 'size') * 3); }
|
|
21
13
|
&::after {
|
|
22
|
-
right: map
|
|
23
|
-
width: map
|
|
24
|
-
height: map
|
|
14
|
+
right: map.get($theme, 'size');
|
|
15
|
+
width: map.get($theme, 'size');
|
|
16
|
+
height: map.get($theme, 'size');
|
|
25
17
|
}
|
|
26
18
|
}
|
|
27
|
-
@if map
|
|
19
|
+
@if map.has-key($theme, 'weight') {
|
|
28
20
|
&::after {
|
|
29
|
-
border-bottom-width: map
|
|
30
|
-
border-right-width: map
|
|
21
|
+
border-bottom-width: map.get($theme, 'weight');
|
|
22
|
+
border-right-width: map.get($theme, 'weight');
|
|
31
23
|
}
|
|
32
24
|
}
|
|
33
|
-
@if map
|
|
34
|
-
&::before { background-color: map
|
|
25
|
+
@if map.has-key($theme, 'bgcolor') {
|
|
26
|
+
&::before { background-color: map.get($theme, 'bgcolor'); }
|
|
35
27
|
}
|
|
36
|
-
@if map
|
|
28
|
+
@if map.has-key($theme, 'color') {
|
|
37
29
|
&::after {
|
|
38
|
-
border-bottom-color: map
|
|
39
|
-
border-right-color: map
|
|
30
|
+
border-bottom-color: map.get($theme, 'color');
|
|
31
|
+
border-right-color: map.get($theme, 'color');
|
|
40
32
|
}
|
|
41
33
|
}
|
|
42
34
|
}
|
|
43
35
|
|
|
44
|
-
[#{
|
|
36
|
+
[#{v.$loop-component-prefix}-form~="select"] {
|
|
45
37
|
position: relative;
|
|
46
38
|
display: block;
|
|
47
|
-
min-height:
|
|
48
|
-
font-size:
|
|
49
|
-
line-height:
|
|
39
|
+
min-height: v.$input-height;
|
|
40
|
+
font-size: v.$input-font-size;
|
|
41
|
+
line-height: v.$input-line-height;
|
|
50
42
|
|
|
51
43
|
&::before {
|
|
52
44
|
position: absolute;
|
|
@@ -56,11 +48,11 @@ $select-themes: (
|
|
|
56
48
|
|
|
57
49
|
content: '';
|
|
58
50
|
|
|
59
|
-
border-top:
|
|
60
|
-
border-right:
|
|
61
|
-
border-bottom:
|
|
62
|
-
border-top-right-radius:
|
|
63
|
-
border-bottom-right-radius:
|
|
51
|
+
border-top: v.$input-border;
|
|
52
|
+
border-right: v.$input-border;
|
|
53
|
+
border-bottom: v.$input-border;
|
|
54
|
+
border-top-right-radius: v.$input-border-radius;
|
|
55
|
+
border-bottom-right-radius: v.$input-border-radius;
|
|
64
56
|
|
|
65
57
|
pointer-events: none;
|
|
66
58
|
}
|
|
@@ -79,14 +71,14 @@ $select-themes: (
|
|
|
79
71
|
}
|
|
80
72
|
|
|
81
73
|
@include selectTheme((
|
|
82
|
-
'size' :
|
|
83
|
-
'color':
|
|
84
|
-
'bgcolor':
|
|
85
|
-
'weight':
|
|
74
|
+
'size' : v.$select-size,
|
|
75
|
+
'color': v.$select-color,
|
|
76
|
+
'bgcolor': v.$select-bgcolor,
|
|
77
|
+
'weight': v.$select-weight,
|
|
86
78
|
));
|
|
87
79
|
|
|
88
80
|
> select {
|
|
89
|
-
@
|
|
81
|
+
@include m.input;
|
|
90
82
|
margin: 0;
|
|
91
83
|
height: 100%;
|
|
92
84
|
font-size: inherit;
|
|
@@ -98,9 +90,9 @@ $select-themes: (
|
|
|
98
90
|
}
|
|
99
91
|
}
|
|
100
92
|
|
|
101
|
-
@if isNotEmpty(
|
|
102
|
-
@each $theme-name, $theme in
|
|
103
|
-
&[#{
|
|
93
|
+
@if fn.isNotEmpty(v.$select-themes) and fn.isMap(v.$select-themes) {
|
|
94
|
+
@each $theme-name, $theme in v.$select-themes {
|
|
95
|
+
&[#{v.$loop-component-prefix}-form~="#{$theme-name}"] {
|
|
104
96
|
@include selectTheme($theme);
|
|
105
97
|
}
|
|
106
98
|
}
|
|
@@ -120,9 +112,9 @@ $select-themes: (
|
|
|
120
112
|
}
|
|
121
113
|
}
|
|
122
114
|
|
|
123
|
-
@if isNotEmpty(
|
|
124
|
-
@each $name, $padding in
|
|
125
|
-
[#{
|
|
115
|
+
@if fn.isNotEmpty(v.$input-padding-sizes) {
|
|
116
|
+
@each $name, $padding in v.$input-padding-sizes {
|
|
117
|
+
[#{v.$loop-component-prefix}-form~="select"][#{v.$loop-component-prefix}-form~="#{$name}"] > select {
|
|
126
118
|
padding: #{$padding};
|
|
127
119
|
padding-right: 0;
|
|
128
120
|
}
|
|
@@ -1,21 +1,12 @@
|
|
|
1
1
|
@use 'sass:math';
|
|
2
|
+
@use '../../variables' as v;
|
|
3
|
+
@use '../../functions/type';
|
|
4
|
+
@use 'mixin' as m;
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
7
|
* Toggle
|
|
5
8
|
*/
|
|
6
9
|
|
|
7
|
-
$toggle-size: 2.4rem !default;
|
|
8
|
-
$toggle-color: $input-bgcolor !default;
|
|
9
|
-
$toggle-bgcolor: $input-border-color !default;
|
|
10
|
-
$toggle-border-color: $toggle-bgcolor !default;
|
|
11
|
-
$toggle-box-shadow: $checkbox-box-shadow !default;
|
|
12
|
-
|
|
13
|
-
$toggle-checked-bgcolor: $input-color !default;
|
|
14
|
-
$toggle-checked-border-color: $toggle-checked-bgcolor !default;
|
|
15
|
-
|
|
16
|
-
$use-toggle-animation: true !default;
|
|
17
|
-
$toggle-sizes:() !default;
|
|
18
|
-
|
|
19
10
|
@mixin toggle-size($size) {
|
|
20
11
|
& + label {
|
|
21
12
|
&::before {
|
|
@@ -31,7 +22,7 @@ $toggle-sizes:() !default;
|
|
|
31
22
|
min-height: $size;
|
|
32
23
|
}
|
|
33
24
|
|
|
34
|
-
& + [#{
|
|
25
|
+
& + [#{v.$loop-component-prefix}-form~="toggle"] + label { margin-top: math.div($size, 3); }
|
|
35
26
|
}
|
|
36
27
|
|
|
37
28
|
&:checked + label::before {
|
|
@@ -39,7 +30,7 @@ $toggle-sizes:() !default;
|
|
|
39
30
|
}
|
|
40
31
|
}
|
|
41
32
|
|
|
42
|
-
[#{
|
|
33
|
+
[#{v.$loop-component-prefix}-form~="toggle"] {
|
|
43
34
|
position: absolute;
|
|
44
35
|
opacity: 0;
|
|
45
36
|
|
|
@@ -49,17 +40,17 @@ $toggle-sizes:() !default;
|
|
|
49
40
|
align-items: center;
|
|
50
41
|
width: fit-content;
|
|
51
42
|
line-height: 1.1;
|
|
52
|
-
font-weight:
|
|
43
|
+
font-weight: v.$font-weight-base;
|
|
53
44
|
|
|
54
45
|
&::before {
|
|
55
46
|
position: absolute;
|
|
56
47
|
left: 0;
|
|
57
48
|
content: '';
|
|
58
49
|
border-radius: 50%;
|
|
59
|
-
background-color:
|
|
60
|
-
box-shadow:
|
|
50
|
+
background-color: v.$toggle-color;
|
|
51
|
+
box-shadow: v.$toggle-box-shadow;
|
|
61
52
|
|
|
62
|
-
@if
|
|
53
|
+
@if v.$use-toggle-animation {
|
|
63
54
|
transition: transform 300ms ease-out;
|
|
64
55
|
}
|
|
65
56
|
}
|
|
@@ -67,30 +58,30 @@ $toggle-sizes:() !default;
|
|
|
67
58
|
display: flex;
|
|
68
59
|
order: -1;
|
|
69
60
|
content:'';
|
|
70
|
-
border: 1px solid
|
|
61
|
+
border: 1px solid v.$toggle-border-color;
|
|
71
62
|
border-radius: 50em;
|
|
72
|
-
background-color:
|
|
73
|
-
box-shadow:
|
|
63
|
+
background-color: v.$toggle-bgcolor;
|
|
64
|
+
box-shadow: v.$toggle-box-shadow;
|
|
74
65
|
|
|
75
|
-
@if
|
|
66
|
+
@if v.$use-toggle-animation {
|
|
76
67
|
transition: background-color 300ms ease-in-out, border-color 300ms ease-in-out;
|
|
77
68
|
}
|
|
78
69
|
}
|
|
79
70
|
}
|
|
80
71
|
|
|
81
72
|
&:checked + label::after {
|
|
82
|
-
background-color:
|
|
83
|
-
border-color:
|
|
73
|
+
background-color: v.$toggle-checked-bgcolor;
|
|
74
|
+
border-color: v.$toggle-checked-border-color;
|
|
84
75
|
}
|
|
85
|
-
&:focus + label::after { @
|
|
76
|
+
&:focus + label::after { @include m.inputFocus; }
|
|
86
77
|
|
|
87
|
-
@include toggle-size(
|
|
78
|
+
@include toggle-size(v.$toggle-size);
|
|
88
79
|
|
|
89
|
-
@if isMap(
|
|
90
|
-
@each $size_name, $size_value in
|
|
91
|
-
&[#{
|
|
80
|
+
@if type.isMap(v.$toggle-sizes) {
|
|
81
|
+
@each $size_name, $size_value in v.$toggle-sizes {
|
|
82
|
+
&[#{v.$loop-component-prefix}-form~="#{$size_name}"] { @include toggle-size($size_value) }
|
|
92
83
|
}
|
|
93
84
|
}
|
|
94
85
|
|
|
95
|
-
[#{
|
|
86
|
+
[#{v.$loop-component-prefix}-form~="labelless"] + label::after { margin-right: 0; }
|
|
96
87
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use 'sass:meta';
|
|
4
|
+
|
|
5
|
+
@use 'empty';
|
|
2
6
|
|
|
3
7
|
/**
|
|
4
8
|
* In List
|
|
@@ -8,7 +12,7 @@
|
|
|
8
12
|
*/
|
|
9
13
|
|
|
10
14
|
@function inList($needle, $haystack) {
|
|
11
|
-
@if index($haystack, $needle) == null {
|
|
15
|
+
@if list.index($haystack, $needle) == null {
|
|
12
16
|
@return false;
|
|
13
17
|
} @else {
|
|
14
18
|
@return true;
|
|
@@ -16,7 +20,7 @@
|
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
@function notInList($needle, $haystack) {
|
|
19
|
-
@return if(inList($needle, $haystack)
|
|
23
|
+
@return if(sass(inList($needle, $haystack)): false; else: true);
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
// inArray Deprecated
|
|
@@ -35,15 +39,15 @@
|
|
|
35
39
|
$merge: ();
|
|
36
40
|
|
|
37
41
|
// merge if $array1 or $array2 is not empty
|
|
38
|
-
@if isNotEmpty($array1) {
|
|
39
|
-
@if type-of($array1) == 'list' and type-of($array2) == 'list' {
|
|
40
|
-
$merge: join($array1, $array2);
|
|
41
|
-
} @else if type-of($array1) == 'map' and type-of($array2) == 'map' {
|
|
42
|
-
$merge: map
|
|
42
|
+
@if empty.isNotEmpty($array1) {
|
|
43
|
+
@if meta.type-of($array1) == 'list' and meta.type-of($array2) == 'list' {
|
|
44
|
+
$merge: list.join($array1, $array2);
|
|
45
|
+
} @else if meta.type-of($array1) == 'map' and meta.type-of($array2) == 'map' {
|
|
46
|
+
$merge: map.merge($array1, $array2);
|
|
43
47
|
} @else {
|
|
44
48
|
$merge: $array1;
|
|
45
49
|
}
|
|
46
|
-
} @else if isNotEmpty($array2) {
|
|
50
|
+
} @else if empty.isNotEmpty($array2) {
|
|
47
51
|
$merge: $array2;
|
|
48
52
|
}
|
|
49
53
|
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "sass:list";
|
|
2
|
+
@use "sass:string";
|
|
3
|
+
|
|
4
|
+
@use 'type';
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
7
|
* Empty
|
|
@@ -7,9 +10,9 @@
|
|
|
7
10
|
*/
|
|
8
11
|
|
|
9
12
|
@function isEmpty($data) {
|
|
10
|
-
@if isString($data) and
|
|
13
|
+
@if type.isString($data) and string.length($data) == 0 {
|
|
11
14
|
@return true;
|
|
12
|
-
} @else if isList($data) and length($data) == 0 {
|
|
15
|
+
} @else if type.isList($data) and list.length($data) == 0 {
|
|
13
16
|
@return true;
|
|
14
17
|
} @else {
|
|
15
18
|
@return false;
|
|
@@ -17,5 +20,5 @@
|
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
@function isNotEmpty($data) {
|
|
20
|
-
@return if(isEmpty($data)
|
|
23
|
+
@return if(sass(isEmpty($data)): false; else: true);
|
|
21
24
|
}
|
package/scss/functions/_map.scss
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* getMapValue
|
|
3
5
|
* @param $map map map of data
|
|
@@ -5,11 +7,11 @@
|
|
|
5
7
|
* @return string
|
|
6
8
|
*/
|
|
7
9
|
@function getMapValue($map, $key) {
|
|
8
|
-
@if map
|
|
10
|
+
@if map.has-key($map, $key) == false {
|
|
9
11
|
@warn ('key does not exist when using getMapValue()');
|
|
10
12
|
@return '';
|
|
11
13
|
}
|
|
12
|
-
@return map
|
|
14
|
+
@return map.get($map, $key);
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
/**
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@use 'sass:meta';
|
|
2
|
+
@use 'sass:string';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Replace
|
|
3
6
|
* @param string $search The value being searched
|
|
@@ -8,10 +11,10 @@
|
|
|
8
11
|
*/
|
|
9
12
|
|
|
10
13
|
@function replace($search, $replace, $subject) {
|
|
11
|
-
$searchIndex:
|
|
12
|
-
@if type-of($search) == 'string' and type-of($replace) == 'string' and type-of($subject) == 'string' and $searchIndex {
|
|
13
|
-
$subjectStart:
|
|
14
|
-
$subjectEnd:
|
|
14
|
+
$searchIndex: string.index($subject, $search);
|
|
15
|
+
@if meta.type-of($search) == 'string' and meta.type-of($replace) == 'string' and meta.type-of($subject) == 'string' and $searchIndex {
|
|
16
|
+
$subjectStart: string.slice($subject, 1, $searchIndex - 1);
|
|
17
|
+
$subjectEnd: string.slice($subject, $searchIndex + string.length($search));
|
|
15
18
|
$newSubject: $subjectStart + $replace + $subjectEnd;
|
|
16
19
|
@return replace($search, $replace, $newSubject);
|
|
17
20
|
} @else {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
@use 'sass:string';
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* Split
|
|
3
7
|
* @param string $pattern The string character to split your string by
|
|
@@ -8,14 +12,14 @@
|
|
|
8
12
|
*/
|
|
9
13
|
|
|
10
14
|
@function split($pattern, $subject, $list:()) {
|
|
11
|
-
$searchIndex:
|
|
12
|
-
@if type-of($pattern) == 'string' and type-of($subject) == 'string' and $searchIndex {
|
|
13
|
-
$subjectStart:
|
|
14
|
-
$subjectEnd:
|
|
15
|
-
$newList: join($list, $subjectStart);
|
|
15
|
+
$searchIndex: string.index($subject, $pattern);
|
|
16
|
+
@if meta.type-of($pattern) == 'string' and meta.type-of($subject) == 'string' and $searchIndex {
|
|
17
|
+
$subjectStart: string.slice($subject, 1, $searchIndex - 1);
|
|
18
|
+
$subjectEnd: string.slice($subject, $searchIndex + string.length($pattern));
|
|
19
|
+
$newList: list.join($list, $subjectStart);
|
|
16
20
|
@return split($pattern, $subjectEnd, $newList);
|
|
17
21
|
} @else {
|
|
18
|
-
$newList: join($list, $subject);
|
|
22
|
+
$newList: list.join($list, $subject);
|
|
19
23
|
@return $newList;
|
|
20
24
|
}
|
|
21
25
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use 'sass:meta';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* isString
|
|
3
5
|
* @param string|list $data
|
|
@@ -5,7 +7,7 @@
|
|
|
5
7
|
*/
|
|
6
8
|
|
|
7
9
|
@function isString($data) {
|
|
8
|
-
@if type-of($data) == 'string'{
|
|
10
|
+
@if meta.type-of($data) == 'string'{
|
|
9
11
|
@return true;
|
|
10
12
|
} @else {
|
|
11
13
|
@return false;
|
|
@@ -13,7 +15,7 @@
|
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
@function isNotString($data) {
|
|
16
|
-
@return if(isString($data)
|
|
18
|
+
@return if(sass(isString($data)): false; else: true);
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
/**
|
|
@@ -23,7 +25,7 @@
|
|
|
23
25
|
*/
|
|
24
26
|
|
|
25
27
|
@function isList($data) {
|
|
26
|
-
@if type-of($data) == 'list'{
|
|
28
|
+
@if meta.type-of($data) == 'list'{
|
|
27
29
|
@return true;
|
|
28
30
|
} @else {
|
|
29
31
|
@return false;
|
|
@@ -31,7 +33,7 @@
|
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
@function isNotList($data) {
|
|
34
|
-
@return if(isList($data)
|
|
36
|
+
@return if(sass(isList($data)): false; else: true);
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
/**
|
|
@@ -41,7 +43,7 @@
|
|
|
41
43
|
*/
|
|
42
44
|
|
|
43
45
|
@function isMap($data) {
|
|
44
|
-
@if type-of($data) == 'map'{
|
|
46
|
+
@if meta.type-of($data) == 'map'{
|
|
45
47
|
@return true;
|
|
46
48
|
} @else {
|
|
47
49
|
@return false;
|
|
@@ -49,5 +51,5 @@
|
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
@function isNotMap($data) {
|
|
52
|
-
@return if(isMap($data)
|
|
54
|
+
@return if(sass(isMap($data)): false; else: true);
|
|
53
55
|
}
|
|
@@ -3,42 +3,32 @@
|
|
|
3
3
|
* based on material guidelines
|
|
4
4
|
* https://material.io/guidelines/layout/responsive-ui.html#responsive-ui-breakpoints
|
|
5
5
|
*/
|
|
6
|
+
@use 'sass:list';
|
|
7
|
+
@use 'sass:map';
|
|
8
|
+
@use '../variables' as v;
|
|
9
|
+
@use '../functions' as fn;
|
|
6
10
|
|
|
7
|
-
@import '../functions/all';
|
|
8
11
|
|
|
9
|
-
$
|
|
10
|
-
xs: 480px, // min width
|
|
11
|
-
sm: 600px, // min width
|
|
12
|
-
md: 960px, // min width
|
|
13
|
-
lg: 1280px, // min width
|
|
14
|
-
) !default;
|
|
15
|
-
|
|
16
|
-
$breakpoints-classes: (sm, md, lg) !default;
|
|
17
|
-
$pointbreaks-classes: (sm, md, lg) !default;
|
|
18
|
-
|
|
19
|
-
// including the first step
|
|
20
|
-
$breakpoints-classes-width-default-value: join('', $breakpoints-classes);
|
|
21
|
-
|
|
22
|
-
@mixin breakpoint($key) {
|
|
12
|
+
@mixin from($key) {
|
|
23
13
|
// make sure the key exist
|
|
24
|
-
@if map
|
|
25
|
-
$width: map
|
|
14
|
+
@if map.has-key(v.$breakpoints, $key) {
|
|
15
|
+
$width: map.get(v.$breakpoints, $key);
|
|
26
16
|
@media (min-width: $width) {
|
|
27
17
|
@content;
|
|
28
18
|
}
|
|
29
|
-
} @else if isEmpty($key) or $key == 'rt' {
|
|
19
|
+
} @else if fn.isEmpty($key) or $key == 'rt' {
|
|
30
20
|
@content;
|
|
31
21
|
}
|
|
32
22
|
}
|
|
33
23
|
|
|
34
|
-
@mixin
|
|
24
|
+
@mixin to($key) {
|
|
35
25
|
// make sure the key exist
|
|
36
|
-
@if map
|
|
37
|
-
$width: map
|
|
26
|
+
@if map.has-key(v.$breakpoints, $key) {
|
|
27
|
+
$width: map.get(v.$breakpoints, $key) - 1;
|
|
38
28
|
@media (max-width: $width) {
|
|
39
29
|
@content;
|
|
40
30
|
}
|
|
41
|
-
} @else if isEmpty($key) or $key == 'rt' {
|
|
31
|
+
} @else if fn.isEmpty($key) or $key == 'rt' {
|
|
42
32
|
@content;
|
|
43
33
|
}
|
|
44
34
|
}
|
package/scss/mixins/_loop.scss
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
* Loop
|
|
3
|
-
*/
|
|
1
|
+
@use 'sass:map';
|
|
4
2
|
|
|
5
|
-
@
|
|
6
|
-
@
|
|
3
|
+
@use 'breakpoint';
|
|
4
|
+
@use '../functions/empty';
|
|
5
|
+
@use '../functions/type';
|
|
7
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Loop properties
|
|
9
|
+
*/
|
|
8
10
|
|
|
9
11
|
@mixin loopProperties($properties, $value, $is-important) {
|
|
10
12
|
// multiple properties
|
|
11
|
-
@if isList($properties) {
|
|
13
|
+
@if type.isList($properties) {
|
|
12
14
|
@each $property in $properties {
|
|
13
|
-
#{$property}: if($is-important
|
|
15
|
+
#{$property}: $value #{if(sass($is-important): '!important')};
|
|
14
16
|
}
|
|
15
17
|
} @else {
|
|
16
|
-
#{$properties}: if($is-important
|
|
18
|
+
#{$properties}: $value #{if(sass($is-important): '!important')};
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
|
|
@@ -31,16 +33,16 @@
|
|
|
31
33
|
$affix: '-';
|
|
32
34
|
|
|
33
35
|
// Make sure to have the correct format or do not generate rules
|
|
34
|
-
@if isNotEmpty($data) {
|
|
35
|
-
@if isMap($data) {
|
|
36
|
+
@if empty.isNotEmpty($data) {
|
|
37
|
+
@if type.isMap($data) {
|
|
36
38
|
@each $key, $value in $data {
|
|
37
|
-
$affix: if(isEmpty($key)
|
|
39
|
+
$affix: if(sass(empty.isEmpty($key)): ''; else: $affix);
|
|
38
40
|
|
|
39
41
|
#{$prefix}#{$affix}#{$key}#{$suffix} {
|
|
40
42
|
// responsive properties ?
|
|
41
|
-
@if isMap($value) {
|
|
43
|
+
@if type.isMap($value) {
|
|
42
44
|
@each $child-breakpoint, $child-value in $value {
|
|
43
|
-
@include breakpoint($child-breakpoint) {
|
|
45
|
+
@include breakpoint.from($child-breakpoint) {
|
|
44
46
|
@include loopProperties($properties, $child-value, $is-important);
|
|
45
47
|
}
|
|
46
48
|
}
|
|
@@ -49,7 +51,7 @@
|
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
|
-
} @else if isList($data) {
|
|
54
|
+
} @else if type.isList($data) {
|
|
53
55
|
@each $value in $data {
|
|
54
56
|
#{$prefix}#{$affix}#{$value}#{$suffix} {
|
|
55
57
|
@include loopProperties($properties, $value, $is-important);
|
|
@@ -75,9 +77,9 @@
|
|
|
75
77
|
* @param $suffix ?string String to append to the selector
|
|
76
78
|
*/
|
|
77
79
|
@mixin loopBreakpoints($breakpoints, $data, $properties, $prefix, $is-important:false, $suffix:'') {
|
|
78
|
-
@if isNotEmpty($breakpoints) and isNotEmpty($data) {
|
|
80
|
+
@if empty.isNotEmpty($breakpoints) and empty.isNotEmpty($data) {
|
|
79
81
|
@each $breakpoint in $breakpoints {
|
|
80
|
-
@include breakpoint($breakpoint) {
|
|
82
|
+
@include breakpoint.from($breakpoint) {
|
|
81
83
|
$suffixes: #{$suffix}\@#{$breakpoint};
|
|
82
84
|
@include loop($data, $properties, $prefix, $is-important, $suffixes);
|
|
83
85
|
}
|
|
@@ -97,12 +99,12 @@
|
|
|
97
99
|
* @param $suffix ?string String to append to the selector
|
|
98
100
|
*/
|
|
99
101
|
@mixin loopMapKeys($keys, $map, $properties, $prefix, $is-important:false, $suffix:'') {
|
|
100
|
-
@if isNotEmpty($keys) {
|
|
102
|
+
@if empty.isNotEmpty($keys) {
|
|
101
103
|
$affix: '-';
|
|
102
104
|
|
|
103
105
|
@each $key in $keys {
|
|
104
|
-
@if map
|
|
105
|
-
$value: map
|
|
106
|
+
@if map.has-key($map, $key) {
|
|
107
|
+
$value: map.get($map, $key);
|
|
106
108
|
$selector: #{$prefix}#{$affix}#{$key}#{$suffix};
|
|
107
109
|
|
|
108
110
|
#{$selector}{
|
|
@@ -1,28 +1,19 @@
|
|
|
1
|
+
@use '../mixins/loop';
|
|
2
|
+
@use '../variables' as v;
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Color Utilities
|
|
3
6
|
*/
|
|
4
7
|
|
|
5
8
|
// Text colors
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
$text-colors-is-important: true !default;
|
|
9
|
-
|
|
10
|
-
@include loop($text-colors, 'color', '.color', $text-colors-is-important);
|
|
11
|
-
@include loopMapKeys($text-colors-classes, $colors, 'color', '.color', $text-colors-is-important);
|
|
9
|
+
@include loop.loop(v.$text-colors, 'color', '.color', v.$text-colors-is-important);
|
|
10
|
+
@include loop.loopMapKeys(v.$text-colors-classes, v.$colors, 'color', '.color', v.$text-colors-is-important);
|
|
12
11
|
|
|
13
12
|
// Bg colors
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
$bg-colors-is-important: false !default;
|
|
17
|
-
|
|
18
|
-
@include loop($bg-colors, 'background-color', '.bg', $bg-colors-is-important);
|
|
19
|
-
@include loopMapKeys($bg-colors-classes, $colors, 'background-color', '.bg', $bg-colors-is-important);
|
|
13
|
+
@include loop.loop(v.$bg-colors, 'background-color', '.bg', v.$bg-colors-is-important);
|
|
14
|
+
@include loop.loopMapKeys(v.$bg-colors-classes, v.$colors, 'background-color', '.bg', v.$bg-colors-is-important);
|
|
20
15
|
|
|
21
16
|
// Border colors
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
$border-colors-is-important: true !default;
|
|
25
|
-
|
|
26
|
-
@include loop($border-colors, 'border-color', '.border', $border-colors-is-important);
|
|
27
|
-
@include loopMapKeys($border-colors-classes, $colors, 'border-color', '.border', $border-colors-is-important);
|
|
17
|
+
@include loop.loop(v.$border-colors, 'border-color', '.border', v.$border-colors-is-important);
|
|
18
|
+
@include loop.loopMapKeys(v.$border-colors-classes, v.$colors, 'border-color', '.border', v.$border-colors-is-important);
|
|
28
19
|
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
+
@use '../variables' as v;
|
|
2
|
+
@use '../mixins/breakpoint';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Container
|
|
3
6
|
*/
|
|
4
7
|
|
|
5
|
-
$container-gutter: 1.6rem !default;
|
|
6
|
-
$container-gutter-sm: 2.4rem !default;
|
|
7
|
-
$containers-max-width: 1080px !default;
|
|
8
|
-
|
|
9
8
|
.container,
|
|
10
9
|
.container-fluid {
|
|
11
10
|
margin-left: auto;
|
|
12
11
|
margin-right: auto;
|
|
13
12
|
|
|
14
|
-
padding-right:
|
|
15
|
-
padding-left:
|
|
13
|
+
padding-right: v.$container-gutter;
|
|
14
|
+
padding-left: v.$container-gutter;
|
|
16
15
|
|
|
17
16
|
display: block;
|
|
18
|
-
max-width:
|
|
17
|
+
max-width: v.$containers-max-width;
|
|
19
18
|
|
|
20
|
-
@include breakpoint(sm) {
|
|
21
|
-
padding-left:
|
|
22
|
-
padding-right:
|
|
19
|
+
@include breakpoint.from(sm) {
|
|
20
|
+
padding-left: v.$container-gutter-sm;
|
|
21
|
+
padding-right: v.$container-gutter-sm;
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
|