@mezzanine-ui/system 0.7.0 → 0.11.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/_system.scss +9 -4
- package/breakpoint/_breakpoint.scss +8 -8
- package/motion/_motion.scss +2 -2
- package/package.json +1 -1
- package/palette/_palette.scss +9 -9
- package/typography/_typography.scss +20 -20
- package/typography/_utils.scss +1 -1
- package/utils/_list.scss +2 -2
- package/z-index/_z-index.scss +1 -1
package/_system.scss
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
@use './spacing';
|
|
4
4
|
@use './typography';
|
|
5
5
|
@use './z-index';
|
|
6
|
+
@use './palette' as system-palette;
|
|
6
7
|
|
|
7
8
|
@mixin common-variables($options: ()) {
|
|
8
9
|
$motion: map.get($options, motion);
|
|
@@ -10,27 +11,31 @@
|
|
|
10
11
|
$typography: map.get($options, typography);
|
|
11
12
|
$z-index: map.get($options, z-index);
|
|
12
13
|
|
|
13
|
-
@if $motion
|
|
14
|
+
@if not $motion {
|
|
14
15
|
@include motion.variables();
|
|
15
16
|
} @else {
|
|
16
17
|
@include motion.variables($motion);
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
@if $spacing
|
|
20
|
+
@if not $spacing {
|
|
20
21
|
@include spacing.variables();
|
|
21
22
|
} @else {
|
|
22
23
|
@include spacing.variables($spacing);
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
@if $typography
|
|
26
|
+
@if not $typography {
|
|
26
27
|
@include typography.variables();
|
|
27
28
|
} @else {
|
|
28
29
|
@include typography.variables($typography);
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
@if $z-index
|
|
32
|
+
@if not $z-index {
|
|
32
33
|
@include z-index.variables();
|
|
33
34
|
} @else {
|
|
34
35
|
@include z-index.variables($z-index);
|
|
35
36
|
}
|
|
36
37
|
}
|
|
38
|
+
|
|
39
|
+
@mixin palette($mode: 'light', $palette: ()) {
|
|
40
|
+
@include system-palette.variables($mode, $palette);
|
|
41
|
+
}
|
|
@@ -25,7 +25,7 @@ $breakpoint-names: (sm, md, lg, xl, xxl);
|
|
|
25
25
|
|
|
26
26
|
@function get($breakpoint-name) {
|
|
27
27
|
@if not is-valid-breakpoint-name($breakpoint-name) {
|
|
28
|
-
@error
|
|
28
|
+
@error 'Invalid breakpoint name #{$breakpoint-name}. Please choose one of #{$breakpoint-names}';
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
@return map.get($breakpoints, $breakpoint-name);
|
|
@@ -33,7 +33,7 @@ $breakpoint-names: (sm, md, lg, xl, xxl);
|
|
|
33
33
|
|
|
34
34
|
@mixin above($min) {
|
|
35
35
|
@if not is-valid-breakpoint-name($min) {
|
|
36
|
-
@error
|
|
36
|
+
@error 'Invalid breakpoint name #{$min}. Please choose one of #{$breakpoint-names}';
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
@media (min-width: get($min)) {
|
|
@@ -43,24 +43,24 @@ $breakpoint-names: (sm, md, lg, xl, xxl);
|
|
|
43
43
|
|
|
44
44
|
@mixin below($max) {
|
|
45
45
|
@if not is-valid-breakpoint-name($max) {
|
|
46
|
-
@error
|
|
46
|
+
@error 'Invalid breakpoint name #{$max}. Please choose one of #{$breakpoint-names}';
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
@media (max-width: get($max) - 1px) {
|
|
49
|
+
@media (max-width: (get($max) - 1px)) {
|
|
50
50
|
@content;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
@mixin between($min: null, $max: null) {
|
|
55
|
-
@if $min
|
|
56
|
-
@error
|
|
55
|
+
@if not $min and not $max {
|
|
56
|
+
@error 'Should provide at least one breakpoint';
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
@if $min
|
|
59
|
+
@if not $min {
|
|
60
60
|
@include below($max) {
|
|
61
61
|
@content;
|
|
62
62
|
}
|
|
63
|
-
} @else if $max
|
|
63
|
+
} @else if not $max {
|
|
64
64
|
@include above($min) {
|
|
65
65
|
@content;
|
|
66
66
|
}
|
package/motion/_motion.scss
CHANGED
|
@@ -35,7 +35,7 @@ $default-options: (
|
|
|
35
35
|
|
|
36
36
|
@function duration($duration-name) {
|
|
37
37
|
@if not is-duration-name-valid($duration-name) {
|
|
38
|
-
@error
|
|
38
|
+
@error 'Invalid duration name #{$duration-name}. Please choose one of #{$duration-names}';
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
@return var(--#{$prefix}-duration-#{$duration-name});
|
|
@@ -43,7 +43,7 @@ $default-options: (
|
|
|
43
43
|
|
|
44
44
|
@function easing($easing-name) {
|
|
45
45
|
@if not is-easing-name-valid($easing-name) {
|
|
46
|
-
@error
|
|
46
|
+
@error 'Invalid easing name #{$easing-name}. Please choose one of #{$easing-names}';
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
@return var(--#{$prefix}-easing-#{$easing-name});
|
package/package.json
CHANGED
package/palette/_palette.scss
CHANGED
|
@@ -9,7 +9,7 @@ $prefix: mzn-color;
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
@function _get-main-color-transformed-palette($color) {
|
|
12
|
-
$rgba: meta.get-function(
|
|
12
|
+
$rgba: meta.get-function('rgba');
|
|
13
13
|
|
|
14
14
|
@return (
|
|
15
15
|
#{$color}-hover-bg: (
|
|
@@ -39,7 +39,7 @@ $prefix: mzn-color;
|
|
|
39
39
|
|
|
40
40
|
$main-color-names: (primary, secondary, error, warning, success);
|
|
41
41
|
$color-names: list.flat-push(
|
|
42
|
-
list.flat-map($main-color-names, meta.get-function(
|
|
42
|
+
list.flat-map($main-color-names, meta.get-function('_get-main-related-color-names')),
|
|
43
43
|
(
|
|
44
44
|
text-primary,
|
|
45
45
|
text-secondary,
|
|
@@ -111,14 +111,14 @@ $default-light-palette: map.assign(
|
|
|
111
111
|
divider: #f2f2f2,
|
|
112
112
|
overlay-bg: (
|
|
113
113
|
from: action-active,
|
|
114
|
-
transformer: meta.get-function(
|
|
114
|
+
transformer: meta.get-function('rgba'),
|
|
115
115
|
args: (
|
|
116
116
|
0.5,
|
|
117
117
|
),
|
|
118
118
|
),
|
|
119
119
|
overlay-surface-bg: (
|
|
120
120
|
from: surface,
|
|
121
|
-
transformer: meta.get-function(
|
|
121
|
+
transformer: meta.get-function('rgba'),
|
|
122
122
|
args: (
|
|
123
123
|
0.9,
|
|
124
124
|
),
|
|
@@ -156,14 +156,14 @@ $default-dark-palette: map.assign(
|
|
|
156
156
|
divider: #494949,
|
|
157
157
|
overlay-bg: (
|
|
158
158
|
from: action-active,
|
|
159
|
-
transformer: meta.get-function(
|
|
159
|
+
transformer: meta.get-function('rgba'),
|
|
160
160
|
args: (
|
|
161
161
|
0.5,
|
|
162
162
|
),
|
|
163
163
|
),
|
|
164
164
|
overlay-surface-bg: (
|
|
165
165
|
from: surface,
|
|
166
|
-
transformer: meta.get-function(
|
|
166
|
+
transformer: meta.get-function('rgba'),
|
|
167
167
|
args: (
|
|
168
168
|
0.9,
|
|
169
169
|
),
|
|
@@ -186,10 +186,10 @@ $default-palette: (
|
|
|
186
186
|
|
|
187
187
|
@each $color-name, $color in $palette {
|
|
188
188
|
@if not is-color-name-valid($color-name) {
|
|
189
|
-
@error
|
|
189
|
+
@error 'Invalid color name #{$color-name}. Please choose one of #{$color-names}';
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
@if meta.type-of($color) !=
|
|
192
|
+
@if meta.type-of($color) != 'color' {
|
|
193
193
|
$color: _transform-color-from-palette($palette, $color);
|
|
194
194
|
}
|
|
195
195
|
|
|
@@ -199,7 +199,7 @@ $default-palette: (
|
|
|
199
199
|
|
|
200
200
|
@function color($color-name) {
|
|
201
201
|
@if not is-color-name-valid($color-name) {
|
|
202
|
-
@error
|
|
202
|
+
@error 'Invalid color name #{$color-name}. Please choose one of #{$color-names}';
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
@return var(--#{$prefix}-#{$color-name});
|
|
@@ -12,7 +12,7 @@ $variants: (h1, h2, h3, h4, h5, h6, body1, body2, caption, button1, button2, but
|
|
|
12
12
|
|
|
13
13
|
$default-options: (
|
|
14
14
|
base: (
|
|
15
|
-
font-family: string.unquote(
|
|
15
|
+
font-family: string.unquote('PingFang TC, Microsoft JhengHei'),
|
|
16
16
|
),
|
|
17
17
|
h1: (
|
|
18
18
|
font-size: px-to-rem(32px),
|
|
@@ -120,12 +120,12 @@ $default-options: (
|
|
|
120
120
|
|
|
121
121
|
@function base-prop($prop, $fallback: null) {
|
|
122
122
|
@if not is-baseprop-valid($prop) {
|
|
123
|
-
@error
|
|
123
|
+
@error 'Invalid base prop #{$prop}. Please choose one of #{$props}';
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
$varname: --#{$prefix}-#{$prop};
|
|
127
127
|
|
|
128
|
-
@if $fallback
|
|
128
|
+
@if not $fallback {
|
|
129
129
|
@return var(#{$varname});
|
|
130
130
|
}
|
|
131
131
|
|
|
@@ -135,16 +135,16 @@ $default-options: (
|
|
|
135
135
|
// Get the css variable of the specific prop of variant.
|
|
136
136
|
@function prop($variant, $prop, $fallback: null) {
|
|
137
137
|
@if not is-variant-valid($variant) {
|
|
138
|
-
@error
|
|
138
|
+
@error 'Invalid variant #{$variant}. Please choose one of #{$variants}';
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
@if not is-prop-valid($prop) {
|
|
142
|
-
@error
|
|
142
|
+
@error 'Invalid prop #{$prop}. Please choose one of #{$props}';
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
$varname: --#{$prefix}-#{$variant}-#{$prop};
|
|
146
146
|
|
|
147
|
-
@if $fallback
|
|
147
|
+
@if not $fallback {
|
|
148
148
|
@return var(#{$varname});
|
|
149
149
|
}
|
|
150
150
|
|
|
@@ -154,7 +154,7 @@ $default-options: (
|
|
|
154
154
|
@function font($variant, $exclude-props: ()) {
|
|
155
155
|
@each $prop in $exclude-props {
|
|
156
156
|
@if $prop == font-family or $prop == font-size or not is-prop-valid($prop) {
|
|
157
|
-
@error
|
|
157
|
+
@error 'Invalid prop #{$prop}. Please choose one of #{$props}';
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
@@ -163,7 +163,7 @@ $default-options: (
|
|
|
163
163
|
$font-weight: if(list.includes($exclude-props, font-weight), null, prop($variant, font-weight));
|
|
164
164
|
|
|
165
165
|
@if not list.includes($exclude-props, line-height) {
|
|
166
|
-
$font-size: $font-size/prop($variant, line-height);
|
|
166
|
+
$font-size: $font-size / prop($variant, line-height);
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
@return $font-weight $font-size $font-family;
|
|
@@ -173,7 +173,7 @@ $default-options: (
|
|
|
173
173
|
// Only accept valid props.
|
|
174
174
|
@each $prop in $exclude-props {
|
|
175
175
|
@if not is-prop-valid($prop) {
|
|
176
|
-
@error
|
|
176
|
+
@error 'Invalid prop #{$prop}. Please choose one of #{$props}';
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
|
|
@@ -193,16 +193,16 @@ $default-options: (
|
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
@mixin partial-variables($options: ()) {
|
|
196
|
-
$base: map.get($options,
|
|
197
|
-
$variants-options: map.omit($options, (
|
|
196
|
+
$base: map.get($options, 'base');
|
|
197
|
+
$variants-options: map.omit($options, ('base'));
|
|
198
198
|
|
|
199
|
-
@if $base
|
|
199
|
+
@if $base {
|
|
200
200
|
@each $prop, $value in $base {
|
|
201
201
|
@if not is-base-prop-valid($prop) {
|
|
202
|
-
@error
|
|
202
|
+
@error 'Invalid base prop #{$prop}. Please choose one of #{$props}';
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
@if $value
|
|
205
|
+
@if $value {
|
|
206
206
|
--#{$prefix}-#{$prop}: #{$value};
|
|
207
207
|
}
|
|
208
208
|
}
|
|
@@ -211,15 +211,15 @@ $default-options: (
|
|
|
211
211
|
@if $variants-options {
|
|
212
212
|
@each $variant, $props-options in $variants-options {
|
|
213
213
|
@if not is-variant-valid($variant) {
|
|
214
|
-
@error
|
|
214
|
+
@error 'Invalid variant #{$variant}. Please choose one of #{$variants}';
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
@each $prop, $value in $props-options {
|
|
218
218
|
@if not is-prop-valid($prop) {
|
|
219
|
-
@error
|
|
219
|
+
@error 'Invalid prop #{$prop}. Please choose one of #{$props}';
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
@if $value
|
|
222
|
+
@if $value {
|
|
223
223
|
--#{$prefix}-#{$variant}-#{$prop}: #{$value};
|
|
224
224
|
}
|
|
225
225
|
}
|
|
@@ -229,17 +229,17 @@ $default-options: (
|
|
|
229
229
|
|
|
230
230
|
@mixin variables($options: (), $defaults: $default-options) {
|
|
231
231
|
$options: map.deep-merge($defaults, $options);
|
|
232
|
-
$variants-options: map.omit($options, (
|
|
232
|
+
$variants-options: map.omit($options, ('base'));
|
|
233
233
|
|
|
234
234
|
@each $variant, $props-options in $variants-options {
|
|
235
235
|
@if not is-variant-valid($variant) {
|
|
236
|
-
@error
|
|
236
|
+
@error 'Invalid variant #{$variant}. Please choose one of #{$variants}';
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
@each $prop in $base-props {
|
|
240
240
|
$value: map.get($options, $variant, $prop);
|
|
241
241
|
|
|
242
|
-
@if $value
|
|
242
|
+
@if not $value {
|
|
243
243
|
$options: map.set($options, $variant, $prop, base-prop($prop));
|
|
244
244
|
}
|
|
245
245
|
}
|
package/typography/_utils.scss
CHANGED
package/utils/_list.scss
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
@each $value in $values {
|
|
15
15
|
$pusher: if(
|
|
16
16
|
meta.type-of($value) == list,
|
|
17
|
-
meta.get-function(
|
|
18
|
-
meta.get-function(
|
|
17
|
+
meta.get-function('join', $module: list),
|
|
18
|
+
meta.get-function('append', $module: list)
|
|
19
19
|
);
|
|
20
20
|
$list: meta.call($pusher, $list, $value);
|
|
21
21
|
}
|
package/z-index/_z-index.scss
CHANGED