igniteui-theming 1.4.3-beta.5 → 1.4.3-beta.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "igniteui-theming",
3
- "version": "1.4.3-beta.5",
3
+ "version": "1.4.3-beta.6",
4
4
  "description": "A set of Sass variables, mixins, and functions for generating palettes, typography, and elevations used by Ignite UI components.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -26,7 +26,7 @@
26
26
  "testEnvironment": "jest-environment-node-single-context"
27
27
  },
28
28
  "lint-staged": {
29
- "**/*.{scss,css}": [
29
+ "sass/**/*.{scss,css}": [
30
30
  "npm run format"
31
31
  ]
32
32
  },
@@ -296,7 +296,7 @@ $_enhanced-accessibility: false;
296
296
  /// $hsl-list: to-hsl(#000); // (0deg, 0%, 0%);
297
297
  /// @return {List} - This list of HSL values.
298
298
  @function to-hsl($color) {
299
- @return (color.hue($color), color.saturation($color), color.lightness($color));
299
+ @return (math.round(color.hue($color)), math.round(color.saturation($color)), math.round(color.lightness($color)));
300
300
  }
301
301
 
302
302
  /// Calculates the contrast ratio between two colors.
@@ -1,4 +1,5 @@
1
1
  @use 'sass:map';
2
+ @use 'sass:list';
2
3
  @use 'sass:meta';
3
4
  @use 'sass:math';
4
5
  @use 'sass:color';
@@ -12,14 +13,23 @@
12
13
  // Generates CSS variables for a base color
13
14
  // @access private
14
15
  @mixin _base($color, $shade, $value) {
15
- $_shade: $shade == 500;
16
- $_valid: meta.type-of($value == 'color');
16
+ @if $shade == 500 {
17
+ $_type: meta.type-of($value);
17
18
 
18
- @if $_shade and $_valid {
19
- --ig-#{$color}-h: #{math.round(color.hue($value))};
20
- --ig-#{$color}-s: #{math.round(color.saturation($value))};
21
- --ig-#{$color}-l: #{math.round(color.lightness($value))};
22
- --ig-#{$color}-a: #{color.alpha($value)};
19
+ @if $_type == 'color' {
20
+ --ig-#{$color}-h: #{math.round(color.hue($value))};
21
+ --ig-#{$color}-s: #{math.round(color.saturation($value))};
22
+ --ig-#{$color}-l: #{math.round(color.lightness($value))};
23
+ --ig-#{$color}-a: #{color.alpha($value)};
24
+ }
25
+
26
+ // Cover handmade palettes with hsl values for base color
27
+ @if $_type == 'list' and list.length($value) == 3 {
28
+ --ig-#{$color}-h: #{list.nth($value, 1)};
29
+ --ig-#{$color}-s: #{list.nth($value, 2)};
30
+ --ig-#{$color}-l: #{list.nth($value, 3)};
31
+ --ig-#{$color}-a: 1;
32
+ }
23
33
  }
24
34
  }
25
35
 
@@ -36,6 +46,10 @@
36
46
  --ig-#{$color}-#{$variant}: #{$value};
37
47
  }
38
48
 
49
+ @if not($_hsl) and not($_contrast) {
50
+ --ig-#{$color}-#{$shade}: #{$value};
51
+ }
52
+
39
53
  @if $_contrast and $contrast {
40
54
  --ig-#{$color}-#{$shade}: #{$value};
41
55
  }
@@ -55,6 +55,7 @@ $dark-fluent-schema: (
55
55
  navbar: $dark-fluent-navbar,
56
56
  input-group: $dark-fluent-input-group,
57
57
  checkbox: $dark-fluent-checkbox,
58
+ switch: $dark-fluent-switch,
58
59
  radio: $dark-fluent-radio,
59
60
  tabs: $dark-fluent-tabs,
60
61
  rating: $dark-fluent-rating,
@@ -113,8 +113,9 @@ $dark-fluent-switch: extend(
113
113
 
114
114
  /// Generates a dark bootstrap switch schema based on a mix of $bootstrap-switch and $base-dark-switch.
115
115
  /// @type {Map}
116
- /// @prop {Color} thumb-on-color [color: ('gray', 900)] - The color of the thumb when the switch is on.
117
- /// @prop {Color} thumb-on-disabled-color [color: ('gray', 900)] - The color of the thumb when the switch is on and disabled.
116
+ /// @prop {Map} thumb-on-color [color: ('gray', 900)] - The color of the thumb when the switch is on.
117
+ /// @prop {Map} thumb-on-disabled-color [color: ('gray', 900)] - The color of the thumb when the switch is on and disabled.
118
+ /// @prop {Map} thumb-on-error-color [color: ('gray', 900)] - The color of the thumb when the switch is on and invalid.
118
119
  /// @requires $bootstrap-switch
119
120
  /// @requires $base-dark-switch
120
121
  $dark-bootstrap-switch: extend(
@@ -133,6 +134,12 @@ $dark-bootstrap-switch: extend(
133
134
  900,
134
135
  ),
135
136
  ),
137
+ thumb-on-error-color: (
138
+ color: (
139
+ 'gray',
140
+ 900,
141
+ ),
142
+ ),
136
143
  )
137
144
  );
138
145
 
@@ -35,12 +35,15 @@
35
35
  /// @prop {Color} border-on-hover-color [transparent] - The border color of the on-switch.
36
36
  /// @prop {Map} label-invalid-color [color: ('gray', 900)] - The color of the switch label in invalid state.
37
37
  /// @prop {Map} track-error-color [color: ('gray', 500)] - The color of the track in invalid state when the switch is off.
38
+ /// @prop {Map} thumb-on-error-color [color: ('secondary', 500)] - The color of the thumb when the switch is on and invalid.
38
39
  /// @prop {Map} error-color [color: ('gray', 50)] - The color of the thumb in invalid state.
39
40
  /// @prop {Map} error-color-hover [color: ('gray', 500)] - The border color in invalid state on hover.
40
41
  /// @requires {Map} $default-elevation-switch
41
42
  $light-switch: extend(
42
43
  $default-elevation-switch,
43
44
  (
45
+ variant: 'material',
46
+ type: 'light',
44
47
  border-color: transparent,
45
48
  border-hover-color: transparent,
46
49
  border-disabled-color: transparent,
@@ -118,6 +121,12 @@ $light-switch: extend(
118
121
  500,
119
122
  ),
120
123
  ),
124
+ thumb-on-error-color: (
125
+ color: (
126
+ 'secondary',
127
+ 500,
128
+ ),
129
+ ),
121
130
  error-color: (
122
131
  color: (
123
132
  'gray',
@@ -157,6 +166,7 @@ $light-switch: extend(
157
166
  /// @prop {Map} focus-outline-color [color: ('gray', 700)] - The focus outlined color.
158
167
  /// @prop {Map} error-color [color: ('gray', 700)] - The border and thumb color in invalid state.
159
168
  /// @prop {Map} error-color-hover [color: ('gray', 800)] - The border and thumb color in invalid state on hover.
169
+ /// @prop {Map} thumb-on-error-color [color: ('gray', 50)] - The color of the thumb when the switch is on and invalid.
160
170
  ///
161
171
  /// @prop {Number} border-radius-track [10px] - The border radius used for switch track. Can be a fraction between 0 and 1, pixels, or percent.
162
172
  ///
@@ -165,6 +175,7 @@ $light-switch: extend(
165
175
  $fluent-switch: extend(
166
176
  $light-switch,
167
177
  (
178
+ variant: 'fluent',
168
179
  focus-outline-color: (
169
180
  color: (
170
181
  'gray',
@@ -244,6 +255,12 @@ $fluent-switch: extend(
244
255
  400,
245
256
  ),
246
257
  ),
258
+ thumb-on-error-color: (
259
+ color: (
260
+ 'gray',
261
+ 50,
262
+ ),
263
+ ),
247
264
  error-color: (
248
265
  color: (
249
266
  'gray',
@@ -283,6 +300,7 @@ $fluent-switch: extend(
283
300
  $bootstrap-switch: extend(
284
301
  $fluent-switch,
285
302
  (
303
+ variant: 'bootstrap',
286
304
  focus-outline-color: (
287
305
  color: (
288
306
  'primary',
@@ -370,6 +388,7 @@ $bootstrap-switch: extend(
370
388
  /// @prop {Map} border-on-color [color: ('primary', 500)] - The border color of the on-switch.
371
389
  /// @prop {Map} border-on-hover-color [color: ('primary', 500)] - The border color of the on-switch.
372
390
  /// @prop {Map} label-disabled-color [color: ('gray', 300)] - The color of the switch label when the switch is disabled
391
+ /// @prop {Map} thumb-on-error-color [color: ('gray', 50)] - The color of the thumb when the switch is on and invalid.
373
392
  /// @prop {Map} error-color [color: ('gray', 500)] - The border and thumb color in invalid state.
374
393
  /// @prop {Map} error-color-hover [color: ('gray', 300)] - The border and thumb color in invalid state on hover.
375
394
  /// @prop {Number} border-radius-track [8px] - The border radius used for switch track. Can be a fraction between 0 and 1, pixels, or percent.
@@ -382,6 +401,7 @@ $bootstrap-switch: extend(
382
401
  $indigo-switch: extend(
383
402
  $light-switch,
384
403
  (
404
+ variant: 'indigo-design',
385
405
  focus-outline-color: (
386
406
  color: (
387
407
  'gray',
@@ -442,6 +462,12 @@ $indigo-switch: extend(
442
462
  500,
443
463
  ),
444
464
  ),
465
+ thumb-on-error-color: (
466
+ color: (
467
+ 'gray',
468
+ 50,
469
+ ),
470
+ ),
445
471
  error-color: (
446
472
  color: (
447
473
  'gray',