igniteui-theming 5.0.0 → 5.1.0

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.
Files changed (30) hide show
  1. package/json/colors/presets/palettes.json +1 -1
  2. package/json/elevations/indigo.json +1 -0
  3. package/json/elevations/material.json +1 -0
  4. package/json/typography/presets/typescales.json +1 -1
  5. package/package.json +22 -12
  6. package/sass/animations/entrances/_flicker.scss +47 -17
  7. package/sass/animations/exits/_flicker.scss +47 -17
  8. package/sass/animations/generic/_shadows.scss +104 -24
  9. package/sass/color/_functions.scss +2 -0
  10. package/sass/color/presets/dark/_bootstrap.scss +0 -3
  11. package/sass/color/presets/dark/_extra.scss +0 -3
  12. package/sass/color/presets/dark/_fluent.scss +0 -3
  13. package/sass/color/presets/dark/_indigo.scss +8 -11
  14. package/sass/color/presets/dark/_material.scss +0 -3
  15. package/sass/color/presets/light/_bootstrap.scss +0 -3
  16. package/sass/color/presets/light/_extra.scss +0 -3
  17. package/sass/color/presets/light/_fluent.scss +0 -3
  18. package/sass/color/presets/light/_indigo.scss +8 -11
  19. package/sass/color/presets/light/_material.scss +0 -3
  20. package/sass/elevations/presets/_indigo.scss +0 -5
  21. package/sass/elevations/presets/_material.scss +0 -5
  22. package/sass/json/README.md +108 -0
  23. package/sass/json/generators.scss +98 -0
  24. package/sass/themes/schemas/components/light/_drop-down.scss +4 -4
  25. package/sass/themes/schemas/components/light/_switch.scss +2 -0
  26. package/sass/typography/presets/_bootstrap.scss +19 -22
  27. package/sass/typography/presets/_fluent.scss +17 -20
  28. package/sass/typography/presets/_indigo.scss +0 -3
  29. package/sass/typography/presets/_material.scss +0 -3
  30. package/json/elevations/elevations.json +0 -1
@@ -24,11 +24,15 @@
24
24
  @mixin shadow-drop-tb {
25
25
  @include keyframes(shadow-drop-tb) {
26
26
  0% {
27
- box-shadow: 0 0 0 0 rgb(0 0 0 / 0%), 0 0 0 0 rgb(0 0 0 / 0%);
27
+ box-shadow:
28
+ 0 0 0 0 rgb(0 0 0 / 0%),
29
+ 0 0 0 0 rgb(0 0 0 / 0%);
28
30
  }
29
31
 
30
32
  100% {
31
- box-shadow: 0 -12px 20px -12px rgb(0 0 0 / 35%), 0 12px 20px -12px rgb(0 0 0 / 35%);
33
+ box-shadow:
34
+ 0 -12px 20px -12px rgb(0 0 0 / 35%),
35
+ 0 12px 20px -12px rgb(0 0 0 / 35%);
32
36
  }
33
37
  }
34
38
  }
@@ -141,11 +145,15 @@
141
145
  @mixin shadow-drop-lr {
142
146
  @include keyframes(shadow-drop-lr) {
143
147
  0% {
144
- box-shadow: 0 0 0 0 rgb(0 0 0 / 0%), 0 0 0 0 rgb(0 0 0 / 0%);
148
+ box-shadow:
149
+ 0 0 0 0 rgb(0 0 0 / 0%),
150
+ 0 0 0 0 rgb(0 0 0 / 0%);
145
151
  }
146
152
 
147
153
  100% {
148
- box-shadow: -12px 0 20px -12px rgb(0 0 0 / 35%), 12px 0 20px -12px rgb(0 0 0 / 35%);
154
+ box-shadow:
155
+ -12px 0 20px -12px rgb(0 0 0 / 35%),
156
+ 12px 0 20px -12px rgb(0 0 0 / 35%);
149
157
  }
150
158
  }
151
159
  }
@@ -170,12 +178,16 @@
170
178
  @include keyframes(shadow-drop-2-tb) {
171
179
  0% {
172
180
  transform: translateZ(0);
173
- box-shadow: 0 0 0 0 rgb(0 0 0 / 0%), 0 0 0 0 rgb(0 0 0 / 0%);
181
+ box-shadow:
182
+ 0 0 0 0 rgb(0 0 0 / 0%),
183
+ 0 0 0 0 rgb(0 0 0 / 0%);
174
184
  }
175
185
 
176
186
  100% {
177
187
  transform: translateZ(50px);
178
- box-shadow: 0 -12px 20px -12px rgb(0 0 0 / 35%), 0 12px 20px -12px rgb(0 0 0 / 35%);
188
+ box-shadow:
189
+ 0 -12px 20px -12px rgb(0 0 0 / 35%),
190
+ 0 12px 20px -12px rgb(0 0 0 / 35%);
179
191
  }
180
192
  }
181
193
  }
@@ -305,12 +317,16 @@
305
317
  @include keyframes(shadow-drop-2-lr) {
306
318
  0% {
307
319
  transform: translateZ(0);
308
- box-shadow: 0 0 0 0 rgb(0 0 0 / 0%), 0 0 0 0 rgb(0 0 0 / 0%);
320
+ box-shadow:
321
+ 0 0 0 0 rgb(0 0 0 / 0%),
322
+ 0 0 0 0 rgb(0 0 0 / 0%);
309
323
  }
310
324
 
311
325
  100% {
312
326
  transform: translateZ(50px);
313
- box-shadow: -12px 0 20px -12px rgb(0 0 0 / 35%), 12px 0 20px -12px rgb(0 0 0 / 35%);
327
+ box-shadow:
328
+ -12px 0 20px -12px rgb(0 0 0 / 35%),
329
+ 12px 0 20px -12px rgb(0 0 0 / 35%);
314
330
  }
315
331
  }
316
332
  }
@@ -319,14 +335,28 @@
319
335
  @mixin shadow-pop-tr {
320
336
  @include keyframes(shadow-pop-tr) {
321
337
  0% {
322
- box-shadow: 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e,
338
+ box-shadow:
339
+ 0 0 #3e3e3e,
340
+ 0 0 #3e3e3e,
341
+ 0 0 #3e3e3e,
342
+ 0 0 #3e3e3e,
343
+ 0 0 #3e3e3e,
344
+ 0 0 #3e3e3e,
345
+ 0 0 #3e3e3e,
323
346
  0 0 #3e3e3e;
324
347
  transform: translateX(0) translateY(0);
325
348
  }
326
349
 
327
350
  100% {
328
- box-shadow: 1px -1px #3e3e3e, 2px -2px #3e3e3e, 3px -3px #3e3e3e, 4px -4px #3e3e3e, 5px -5px #3e3e3e,
329
- 6px -6px #3e3e3e, 7px -7px #3e3e3e, 8px -8px #3e3e3e;
351
+ box-shadow:
352
+ 1px -1px #3e3e3e,
353
+ 2px -2px #3e3e3e,
354
+ 3px -3px #3e3e3e,
355
+ 4px -4px #3e3e3e,
356
+ 5px -5px #3e3e3e,
357
+ 6px -6px #3e3e3e,
358
+ 7px -7px #3e3e3e,
359
+ 8px -8px #3e3e3e;
330
360
  transform: translateX(-8px) translateY(8px);
331
361
  }
332
362
  }
@@ -336,14 +366,28 @@
336
366
  @mixin shadow-pop-br {
337
367
  @include keyframes(shadow-pop-br) {
338
368
  0% {
339
- box-shadow: 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e,
369
+ box-shadow:
370
+ 0 0 #3e3e3e,
371
+ 0 0 #3e3e3e,
372
+ 0 0 #3e3e3e,
373
+ 0 0 #3e3e3e,
374
+ 0 0 #3e3e3e,
375
+ 0 0 #3e3e3e,
376
+ 0 0 #3e3e3e,
340
377
  0 0 #3e3e3e;
341
378
  transform: translateX(0) translateY(0);
342
379
  }
343
380
 
344
381
  100% {
345
- box-shadow: 1px 1px #3e3e3e, 2px 2px #3e3e3e, 3px 3px #3e3e3e, 4px 4px #3e3e3e, 5px 5px #3e3e3e,
346
- 6px 6px #3e3e3e, 7px 7px #3e3e3e, 8px 8px #3e3e3e;
382
+ box-shadow:
383
+ 1px 1px #3e3e3e,
384
+ 2px 2px #3e3e3e,
385
+ 3px 3px #3e3e3e,
386
+ 4px 4px #3e3e3e,
387
+ 5px 5px #3e3e3e,
388
+ 6px 6px #3e3e3e,
389
+ 7px 7px #3e3e3e,
390
+ 8px 8px #3e3e3e;
347
391
  transform: translateX(-8px) translateY(-8px);
348
392
  }
349
393
  }
@@ -353,14 +397,28 @@
353
397
  @mixin shadow-pop-bl {
354
398
  @include keyframes(shadow-pop-bl) {
355
399
  0% {
356
- box-shadow: 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e,
400
+ box-shadow:
401
+ 0 0 #3e3e3e,
402
+ 0 0 #3e3e3e,
403
+ 0 0 #3e3e3e,
404
+ 0 0 #3e3e3e,
405
+ 0 0 #3e3e3e,
406
+ 0 0 #3e3e3e,
407
+ 0 0 #3e3e3e,
357
408
  0 0 #3e3e3e;
358
409
  transform: translateX(0) translateY(0);
359
410
  }
360
411
 
361
412
  100% {
362
- box-shadow: -1px 1px #3e3e3e, -2px 2px #3e3e3e, -3px 3px #3e3e3e, -4px 4px #3e3e3e, -5px 5px #3e3e3e,
363
- -6px 6px #3e3e3e, -7px 7px #3e3e3e, -8px 8px #3e3e3e;
413
+ box-shadow:
414
+ -1px 1px #3e3e3e,
415
+ -2px 2px #3e3e3e,
416
+ -3px 3px #3e3e3e,
417
+ -4px 4px #3e3e3e,
418
+ -5px 5px #3e3e3e,
419
+ -6px 6px #3e3e3e,
420
+ -7px 7px #3e3e3e,
421
+ -8px 8px #3e3e3e;
364
422
  transform: translateX(8px) translateY(-8px);
365
423
  }
366
424
  }
@@ -370,14 +428,28 @@
370
428
  @mixin shadow-pop-tl {
371
429
  @include keyframes(shadow-pop-tl) {
372
430
  0% {
373
- box-shadow: 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e, 0 0 #3e3e3e,
431
+ box-shadow:
432
+ 0 0 #3e3e3e,
433
+ 0 0 #3e3e3e,
434
+ 0 0 #3e3e3e,
435
+ 0 0 #3e3e3e,
436
+ 0 0 #3e3e3e,
437
+ 0 0 #3e3e3e,
438
+ 0 0 #3e3e3e,
374
439
  0 0 #3e3e3e;
375
440
  transform: translateX(0) translateY(0);
376
441
  }
377
442
 
378
443
  100% {
379
- box-shadow: -1px -1px #3e3e3e, -2px -2px #3e3e3e, -3px -3px #3e3e3e, -4px -4px #3e3e3e, -5px -5px #3e3e3e,
380
- -6px -6px #3e3e3e, -7px -7px #3e3e3e, -8px -8px #3e3e3e;
444
+ box-shadow:
445
+ -1px -1px #3e3e3e,
446
+ -2px -2px #3e3e3e,
447
+ -3px -3px #3e3e3e,
448
+ -4px -4px #3e3e3e,
449
+ -5px -5px #3e3e3e,
450
+ -6px -6px #3e3e3e,
451
+ -7px -7px #3e3e3e,
452
+ -8px -8px #3e3e3e;
381
453
  transform: translateX(8px) translateY(8px);
382
454
  }
383
455
  }
@@ -387,11 +459,15 @@
387
459
  @mixin shadow-inset-tb {
388
460
  @include keyframes(shadow-inset-tb) {
389
461
  0% {
390
- box-shadow: inset 0 0 0 0 rgb(0 0 0 / 0%), inset 0 0 0 0 rgb(0 0 0 / 0%);
462
+ box-shadow:
463
+ inset 0 0 0 0 rgb(0 0 0 / 0%),
464
+ inset 0 0 0 0 rgb(0 0 0 / 0%);
391
465
  }
392
466
 
393
467
  100% {
394
- box-shadow: inset 0 -6px 14px -6px rgb(0 0 0 / 50%), inset 0 6px 14px -6px rgb(0 0 0 / 50%);
468
+ box-shadow:
469
+ inset 0 -6px 14px -6px rgb(0 0 0 / 50%),
470
+ inset 0 6px 14px -6px rgb(0 0 0 / 50%);
395
471
  }
396
472
  }
397
473
  }
@@ -517,11 +593,15 @@
517
593
  @mixin shadow-inset-lr {
518
594
  @include keyframes(shadow-inset-lr) {
519
595
  0% {
520
- box-shadow: inset 0 0 0 0 rgb(0 0 0 / 0%), inset 0 0 0 0 rgb(0 0 0 / 0%);
596
+ box-shadow:
597
+ inset 0 0 0 0 rgb(0 0 0 / 0%),
598
+ inset 0 0 0 0 rgb(0 0 0 / 0%);
521
599
  }
522
600
 
523
601
  100% {
524
- box-shadow: inset -6px 0 14px -6px rgb(0 0 0 / 50%), inset 6px 0 14px -6px rgb(0 0 0 / 50%);
602
+ box-shadow:
603
+ inset -6px 0 14px -6px rgb(0 0 0 / 50%),
604
+ inset 6px 0 14px -6px rgb(0 0 0 / 50%);
525
605
  }
526
606
  }
527
607
  }
@@ -145,6 +145,8 @@ $_enhanced-accessibility: false;
145
145
  to-fixed(color.saturation($color) * $sx),
146
146
  to-fixed(color.lightness($color) * $lx)
147
147
  );
148
+
149
+ // prettier-ignore
148
150
  $hsl: #{$h, calc(#{$s} * #{$sx}), calc(#{$l} * #{$lx})};
149
151
 
150
152
  @return (raw: $raw, hsl: $hsl);
@@ -6,9 +6,6 @@
6
6
  /// @access public
7
7
  ////
8
8
 
9
- /**
10
- * @sass-export-section="dark-bootstrap"
11
- */
12
9
  /// Generates the dark bootstrap palette.
13
10
  /// @type Map
14
11
  /// @name dark-bootstrap-palette
@@ -6,9 +6,6 @@
6
6
  /// @access public
7
7
  ////
8
8
 
9
- /**
10
- * @sass-export-section="dark"
11
- */
12
9
  /// Generates the dark green palette.
13
10
  /// @type Map
14
11
  /// @name dark-green-palette
@@ -6,9 +6,6 @@
6
6
  /// @access public
7
7
  ////
8
8
 
9
- /**
10
- * @sass-export-section="dark-fluent"
11
- */
12
9
  /// Generates the dark fluent palette.
13
10
  /// @type Map
14
11
  /// @name dark-fluent-palette
@@ -6,9 +6,6 @@
6
6
  /// @access public
7
7
  ////
8
8
 
9
- /**
10
- * @sass-export-section="dark-indigo"
11
- */
12
9
  /// Generates the dark indigo palette.
13
10
  /// @type Map
14
11
  /// @name dark-indigo-palette
@@ -21,7 +18,7 @@
21
18
  /// @prop {Color} error [#cf1a2b] - The 500 variant of the error color.
22
19
  /// @prop {Color} surface [#1e1f24] - The surface color.
23
20
  $palette: (
24
- primary: (
21
+ 'primary': (
25
22
  50: to-hsl(#c5cdff),
26
23
  '50-contrast': black,
27
24
  100: to-hsl(#a3aff6),
@@ -51,7 +48,7 @@ $palette: (
51
48
  'A700': to-hsl(#262851),
52
49
  'A700-contrast': white,
53
50
  ),
54
- secondary: (
51
+ 'secondary': (
55
52
  50: to-hsl(#c5cdff),
56
53
  '50-contrast': black,
57
54
  100: to-hsl(#a3aff6),
@@ -81,7 +78,7 @@ $palette: (
81
78
  'A700': to-hsl(#262851),
82
79
  'A700-contrast': white,
83
80
  ),
84
- gray: (
81
+ 'gray': (
85
82
  50: to-hsl(#24252c),
86
83
  '50-contrast': white,
87
84
  100: to-hsl(#3b3d47),
@@ -103,7 +100,7 @@ $palette: (
103
100
  900: to-hsl(#fcfcfd),
104
101
  '900-contrast': black,
105
102
  ),
106
- info: (
103
+ 'info': (
107
104
  50: to-hsl(#f1c3ff),
108
105
  '50-contrast': black,
109
106
  100: to-hsl(#e89eff),
@@ -133,7 +130,7 @@ $palette: (
133
130
  'A700': to-hsl(#5c056b),
134
131
  'A700-contrast': white,
135
132
  ),
136
- success: (
133
+ 'success': (
137
134
  50: to-hsl(#edf3e7),
138
135
  '50-contrast': black,
139
136
  100: to-hsl(#d2e2c3),
@@ -163,7 +160,7 @@ $palette: (
163
160
  'A700': to-hsl(#316109),
164
161
  'A700-contrast': white,
165
162
  ),
166
- warn: (
163
+ 'warn': (
167
164
  50: to-hsl(#fed7b7),
168
165
  '50-contrast': black,
169
166
  100: to-hsl(#ffc696),
@@ -193,7 +190,7 @@ $palette: (
193
190
  'A700': to-hsl(#d22900),
194
191
  'A700-contrast': white,
195
192
  ),
196
- error: (
193
+ 'error': (
197
194
  50: to-hsl(#ffebf0),
198
195
  '50-contrast': black,
199
196
  100: to-hsl(#ffb0b7),
@@ -223,7 +220,7 @@ $palette: (
223
220
  'A700': to-hsl(#9f000f),
224
221
  'A700-contrast': white,
225
222
  ),
226
- surface: (
223
+ 'surface': (
227
224
  500: to-hsl(#1e1f24),
228
225
  '500-contrast': white,
229
226
  ),
@@ -6,9 +6,6 @@
6
6
  /// @access public
7
7
  ////
8
8
 
9
- /**
10
- * @sass-export-section="dark-material"
11
- */
12
9
  /// Generates the dark material palette.
13
10
  /// @type Map
14
11
  /// @name dark-material-palette
@@ -6,9 +6,6 @@
6
6
  /// @access public
7
7
  ////
8
8
 
9
- /**
10
- * @sass-export-section="light-bootstrap"
11
- */
12
9
  /// Generates the light bootstrap palette.
13
10
  /// @type Map
14
11
  /// @name light-bootstrap-palette
@@ -6,9 +6,6 @@
6
6
  /// @access public
7
7
  ////
8
8
 
9
- /**
10
- * @sass-export-section="light"
11
- */
12
9
  /// Generates the light green palette.
13
10
  /// @type Map
14
11
  /// @name light-green-palette
@@ -6,9 +6,6 @@
6
6
  /// @access public
7
7
  ////
8
8
 
9
- /**
10
- * @sass-export-section="light-fluent"
11
- */
12
9
  /// Generates the light fluent palette.
13
10
  /// @type Map
14
11
  /// @name light-fluent-palette
@@ -6,9 +6,6 @@
6
6
  /// @access public
7
7
  ////
8
8
 
9
- /**
10
- * @sass-export-section="light-indigo"
11
- */
12
9
  /// Generates the light indigo palette.
13
10
  /// @type Map
14
11
  /// @name light-indigo-palette
@@ -21,7 +18,7 @@
21
18
  /// @prop {Color} error [#cf1a2b] - The 500 variant of the error color.
22
19
  /// @prop {Color} surface [#f8f8fa] - The surface color.
23
20
  $palette: (
24
- primary: (
21
+ 'primary': (
25
22
  50: to-hsl(#c5cdff),
26
23
  '50-contrast': black,
27
24
  100: to-hsl(#a3aff6),
@@ -51,7 +48,7 @@ $palette: (
51
48
  'A700': to-hsl(#262851),
52
49
  'A700-contrast': white,
53
50
  ),
54
- secondary: (
51
+ 'secondary': (
55
52
  50: to-hsl(#c5cdff),
56
53
  '50-contrast': black,
57
54
  100: to-hsl(#a3aff6),
@@ -81,7 +78,7 @@ $palette: (
81
78
  'A700': to-hsl(#262851),
82
79
  'A700-contrast': white,
83
80
  ),
84
- gray: (
81
+ 'gray': (
85
82
  50: to-hsl(#fcfcfd),
86
83
  '50-contrast': black,
87
84
  100: to-hsl(#f8f8fa),
@@ -103,7 +100,7 @@ $palette: (
103
100
  900: to-hsl(#24252c),
104
101
  '900-contrast': white,
105
102
  ),
106
- info: (
103
+ 'info': (
107
104
  50: to-hsl(#f1c3ff),
108
105
  '50-contrast': black,
109
106
  100: to-hsl(#e89eff),
@@ -133,7 +130,7 @@ $palette: (
133
130
  'A700': to-hsl(#5c056b),
134
131
  'A700-contrast': white,
135
132
  ),
136
- success: (
133
+ 'success': (
137
134
  50: to-hsl(#edf3e7),
138
135
  '50-contrast': black,
139
136
  100: to-hsl(#d2e2c3),
@@ -163,7 +160,7 @@ $palette: (
163
160
  'A700': to-hsl(#316109),
164
161
  'A700-contrast': white,
165
162
  ),
166
- warn: (
163
+ 'warn': (
167
164
  50: to-hsl(#fed7b7),
168
165
  '50-contrast': black,
169
166
  100: to-hsl(#ffc696),
@@ -193,7 +190,7 @@ $palette: (
193
190
  'A700': to-hsl(#d22900),
194
191
  'A700-contrast': white,
195
192
  ),
196
- error: (
193
+ 'error': (
197
194
  50: to-hsl(#ffebf0),
198
195
  '50-contrast': black,
199
196
  100: to-hsl(#ffb0b7),
@@ -223,7 +220,7 @@ $palette: (
223
220
  'A700': to-hsl(#9f000f),
224
221
  'A700-contrast': white,
225
222
  ),
226
- surface: (
223
+ 'surface': (
227
224
  500: to-hsl(#f8f8fa),
228
225
  '500-contrast': black,
229
226
  ),
@@ -6,9 +6,6 @@
6
6
  /// @access public
7
7
  ////
8
8
 
9
- /**
10
- * @sass-export-section="light-material"
11
- */
12
9
  /// Generates the light material palette.
13
10
  /// @type Map
14
11
  /// @name light-material-palette
@@ -48,9 +48,6 @@ $_22: box-shadow((0 10px 14px -6px $color-1, 0 22px 35px 3px $color-2, 0 8px 42p
48
48
  $_23: box-shadow((0 0 16px 0 rgba(0 0 0 / 30%)));
49
49
  $_24: box-shadow((0 0 16px 0 rgba(36 37 44 / 40%)));
50
50
 
51
- /**
52
- * @sass-export-section="indigo"
53
- */
54
51
  /// А map of 24 shadow elevations with the umbra, penumbra and ambient shadows.
55
52
  /// @type Map
56
53
  /// @access private
@@ -81,5 +78,3 @@ $elevations: (
81
78
  23: $_23,
82
79
  24: $_24,
83
80
  );
84
-
85
- // @end-sass-export-section
@@ -48,9 +48,6 @@ $_22: box-shadow((0 10px 14px -6px $color-1, 0 22px 35px 3px $color-2, 0 8px 42p
48
48
  $_23: box-shadow((0 11px 14px -7px $color-1, 0 23px 36px 3px $color-2, 0 9px 44px 8px $color-3));
49
49
  $_24: box-shadow((0 11px 15px -7px $color-1, 0 24px 38px 3px $color-2, 0 9px 46px 8px $color-3));
50
50
 
51
- /**
52
- * @sass-export-section="material"
53
- */
54
51
  /// А map of 24 shadow elevations with the umbra, penumbra and ambient shadows.
55
52
  /// @type Map
56
53
  /// @access private
@@ -81,5 +78,3 @@ $elevations: (
81
78
  23: $_23,
82
79
  24: $_24,
83
80
  );
84
-
85
- // @end-sass-export-section
@@ -0,0 +1,108 @@
1
+ # What is this?
2
+
3
+ This folder contains generator files that can be used by the `src/buildJSON.mjs` script to produce JSON files containing serialized information about various parts of the theming package (ex. palettes, typography, elevations, etc.);
4
+
5
+ The `generators.scss` file contains declarations for how each of the JSON files should be generated, where each file should be placed and what its contents are.
6
+
7
+ To achieve this a small [DSL](https://en.wikipedia.org/wiki/Domain-specific_language) on top of CSS is used. A tiny [parser](../../scripts/parser.mjs) handles the transformation of this custom CSS into JSON.
8
+
9
+ From this point on, this document explains the syntax of the DSL.
10
+
11
+ ## Base Syntax
12
+
13
+ #### Example of the DSL syntax (Input)
14
+ ```css
15
+ /*
16
+ * @outputDir - /custom
17
+ */
18
+ example {
19
+ --content: "Hello, World!"
20
+ }
21
+ ```
22
+
23
+ The declaration above will produce the following JSON file when `$ npm run build:json` is run.
24
+
25
+ #### Output (`igniteui-theming/json/custom/example.json`)
26
+
27
+ ```json
28
+ {
29
+ "content": "Hello, World!"
30
+ }
31
+ ```
32
+
33
+ To generate a new JSON file, you need to add a new `scss` document in this folder or update the contents of the `generators.scss` file.
34
+
35
+ ### Specifying output directory for the JSON file
36
+
37
+ The output directory is specified using a comment directly above the declaration body with a string marker of `@outputDir` separated by a `-` followed by the desired location of the generated JSON file relative to the `json` directory located at the root of this project(see the example above). If no comment is specified, the last existing comment specifying an `@outputDir` will be used. If there's no other comment above the declaration specifying an `@outputDir`, the declaration is ignored and no output file is generated.
38
+
39
+ ### JSON declaration
40
+
41
+ ```css
42
+ example {
43
+ --content: "Hello, World!"
44
+ }
45
+ ```
46
+
47
+ Given the above snippet, the first present selector, i.e. `example`, will be used as the name of the JSON file. Any custom property declaration in the body of the selector, in this case `--content`, will be used to generate a key within the generated JSON file. The opening `{` and closing `}` braces define the scope of the JSON object. The value that will be assigned to the `content` key is anything to the right of the `:`.
48
+
49
+ ##### Grouping several keys together into an object:
50
+
51
+ ###### Input
52
+ ```css
53
+ example {
54
+ > group > x {
55
+ --a: 'a';
56
+ }
57
+
58
+ > group > y {
59
+ --b: 'b';
60
+ }
61
+ }
62
+ ```
63
+
64
+ The declaration above produces the following JSON:
65
+
66
+ ###### Output
67
+ ```json
68
+ {
69
+ "group": {
70
+ "x": {
71
+ "a": "a"
72
+ },
73
+ "y": {
74
+ "b": "b"
75
+ }
76
+ }
77
+ }
78
+ ```
79
+
80
+ The `>` operator defines nested structures within the current JSON object. If the parser encounters common denominators like `group` it will group the statements, in this case `x` and `y`, together in the `group` object.
81
+
82
+ ##### Handling array-like objects
83
+
84
+ You can produce arrays in the JSON file by declaring an array-like object as the value of a key.
85
+
86
+ ###### Example
87
+ ```css
88
+ example {
89
+ --array-like: [1, a, 2.4];
90
+ }
91
+ ```
92
+
93
+ ###### Output
94
+ ```json
95
+ {
96
+ "array-like": ["1", "a", "2.4"]
97
+ }
98
+ ```
99
+
100
+ **NOTE**: The array-like only supports simple values (strings and numbers). You can't pass in an object block and expect to get a valid JSON.
101
+
102
+ #### Generating the JSON Files
103
+
104
+ To generate the JSON files run:
105
+
106
+ ```sh
107
+ npm run build:json
108
+ ```