@carbon/type 10.44.0-rc.0 → 11.0.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 (78) hide show
  1. package/README.md +2 -6
  2. package/index.scss +7 -7
  3. package/package.json +6 -6
  4. package/scss/_classes.scss +8 -7
  5. package/scss/{modules/_default-type.scss → _default-type.scss} +2 -8
  6. package/scss/_font-family.scss +51 -17
  7. package/scss/_inlined/_classes.scss +8 -7
  8. package/scss/_inlined/_default-type.scss +49 -0
  9. package/scss/_inlined/_font-family.scss +51 -17
  10. package/scss/_inlined/_reset.scss +11 -59
  11. package/scss/_inlined/_scale.scss +13 -15
  12. package/scss/_inlined/_styles.scss +146 -214
  13. package/scss/_reset.scss +11 -59
  14. package/scss/_scale.scss +13 -15
  15. package/scss/_styles.scss +146 -214
  16. package/scss/vendor/@carbon/grid/{modules/_breakpoint.scss → _breakpoint.scss} +1 -1
  17. package/scss/vendor/@carbon/grid/{modules/_config.scss → _config.scss} +1 -1
  18. package/scss/vendor/@carbon/grid/{modules/_css-grid.scss → _css-grid.scss} +0 -0
  19. package/scss/vendor/@carbon/grid/{modules/_flex-grid.scss → _flex-grid.scss} +0 -20
  20. package/scss/vendor/@carbon/grid/_inlined/_breakpoint.scss +198 -0
  21. package/scss/vendor/@carbon/grid/_inlined/_config.scss +94 -0
  22. package/scss/vendor/@carbon/grid/_inlined/_css-grid.scss +470 -0
  23. package/scss/vendor/@carbon/grid/{modules/_mixins.scss → _inlined/_flex-grid.scss} +45 -38
  24. package/scss/vendor/@carbon/grid/_inlined/_mixins.scss +89 -188
  25. package/scss/vendor/@carbon/grid/_mixins.scss +89 -188
  26. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_convert.import.scss +2 -4
  27. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_convert.scss +18 -23
  28. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_spacing.scss +2 -5
  29. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_utilities.scss +4 -4
  30. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_container.scss +13 -43
  31. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_fluid-spacing.scss +11 -35
  32. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_icon-size.scss +8 -17
  33. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_size.scss +1 -1
  34. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_spacing.scss +29 -107
  35. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/modules/_convert.scss +2 -4
  36. package/scss/_inlined/_styles.import.scss +0 -766
  37. package/scss/_inlined/font-face/_mono.scss +0 -1166
  38. package/scss/_inlined/font-face/_sans-condensed.scss +0 -1009
  39. package/scss/_inlined/font-face/_sans.scss +0 -1326
  40. package/scss/_inlined/font-face/_serif.scss +0 -1166
  41. package/scss/_inlined/font-face/_settings.scss +0 -12
  42. package/scss/_styles.import.scss +0 -766
  43. package/scss/font-face/_mono.scss +0 -1166
  44. package/scss/font-face/_sans-condensed.scss +0 -1009
  45. package/scss/font-face/_sans.scss +0 -1326
  46. package/scss/font-face/_serif.scss +0 -1166
  47. package/scss/font-face/_settings.scss +0 -12
  48. package/scss/index.scss +0 -8
  49. package/scss/modules/_classes.scss +0 -42
  50. package/scss/modules/_font-family.scss +0 -104
  51. package/scss/modules/_prefix.scss +0 -11
  52. package/scss/modules/_reset.scss +0 -44
  53. package/scss/modules/_scale.scss +0 -57
  54. package/scss/modules/_styles.scss +0 -876
  55. package/scss/type.scss +0 -8
  56. package/scss/vendor/@carbon/grid/12.scss +0 -41
  57. package/scss/vendor/@carbon/grid/_inlined/12.scss +0 -41
  58. package/scss/vendor/@carbon/grid/_inlined/_mixins.import.scss +0 -431
  59. package/scss/vendor/@carbon/grid/_inlined/_prefix.scss +0 -12
  60. package/scss/vendor/@carbon/grid/_mixins.import.scss +0 -431
  61. package/scss/vendor/@carbon/grid/_prefix.scss +0 -12
  62. package/scss/vendor/@carbon/grid/grid.scss +0 -10
  63. package/scss/vendor/@carbon/grid/index.scss +0 -10
  64. package/scss/vendor/@carbon/grid/vendor/@carbon/import-once/import-once.scss +0 -27
  65. package/scss/vendor/@carbon/grid/vendor/@carbon/import-once/index.scss +0 -8
  66. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_breakpoint.scss +0 -246
  67. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_key-height.import.scss +0 -117
  68. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_key-height.scss +0 -111
  69. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_mini-unit.scss +0 -23
  70. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_layout.scss +0 -97
  71. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/index.scss +0 -8
  72. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/layout.scss +0 -12
  73. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/modules/_spacing.scss +0 -9
  74. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/modules/_utilities.scss +0 -41
  75. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/modules/generated/_fluid-spacing.scss +0 -37
  76. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/modules/generated/_spacing.scss +0 -91
  77. package/scss/vendor/@carbon/import-once/import-once.scss +0 -27
  78. package/scss/vendor/@carbon/import-once/index.scss +0 -8
@@ -1,876 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2018, 2018
3
- //
4
- // This source code is licensed under the Apache-2.0 license found in the
5
- // LICENSE file in the root directory of this source tree.
6
- //
7
-
8
- // stylelint-disable number-max-precision
9
-
10
- @use 'sass:map';
11
- @use 'sass:math';
12
- @use '@carbon/grid/scss/modules/config' as gridconfig;
13
- @use '@carbon/grid/scss/modules/breakpoint' as grid;
14
- @use 'font-family';
15
- @use 'scale';
16
-
17
- /// @type Map
18
- /// @access public
19
- /// @deprecated
20
- /// @group @carbon/type
21
- $caption-01: (
22
- font-size: scale.type-scale(1),
23
- font-weight: font-family.font-weight('regular'),
24
- line-height: 1.33333,
25
- letter-spacing: 0.32px,
26
- ) !default;
27
-
28
- /// @type Map
29
- /// @access public
30
- /// @group @carbon/type
31
- $label-01: (
32
- font-size: scale.type-scale(1),
33
- font-weight: font-family.font-weight('regular'),
34
- line-height: 1.33333,
35
- letter-spacing: 0.32px,
36
- ) !default;
37
-
38
- /// @type Map
39
- /// @access public
40
- /// @group @carbon/type
41
- $legal-01: (
42
- font-size: scale.type-scale(1),
43
- font-weight: font-family.font-weight('regular'),
44
- line-height: 1.33333,
45
- letter-spacing: 0.32px,
46
- ) !default;
47
-
48
- /// @type Map
49
- /// @access public
50
- /// @group @carbon/type
51
- $legal-02: (
52
- font-size: scale.type-scale(2),
53
- font-weight: font-family.font-weight('regular'),
54
- line-height: 1.28572,
55
- letter-spacing: 0.16px,
56
- ) !default;
57
-
58
- /// @type Map
59
- /// @access public
60
- /// @deprecated
61
- /// @group @carbon/type
62
- $helper-text-01: (
63
- font-size: scale.type-scale(1),
64
- line-height: 1.33333,
65
- letter-spacing: 0.32px,
66
- ) !default;
67
-
68
- /// @type Map
69
- /// @access public
70
- /// @group @carbon/type
71
- $body-short-01: (
72
- font-size: scale.type-scale(2),
73
- font-weight: font-family.font-weight('regular'),
74
- line-height: 1.28572,
75
- letter-spacing: 0.16px,
76
- ) !default;
77
-
78
- /// @type Map
79
- /// @access public
80
- /// @group @carbon/type
81
- $body-compact-01: $body-short-01 !default;
82
-
83
- /// @type Map
84
- /// @access public
85
- /// @group @carbon/type
86
- $body-long-01: (
87
- font-size: scale.type-scale(2),
88
- font-weight: font-family.font-weight('regular'),
89
- line-height: 1.42857,
90
- letter-spacing: 0.16px,
91
- ) !default;
92
-
93
- /// @type Map
94
- /// @access public
95
- /// @group @carbon/type
96
- $body-01: $body-long-01 !default;
97
-
98
- /// @type Map
99
- /// @access public
100
- /// @group @carbon/type
101
- $body-short-02: (
102
- font-size: scale.type-scale(3),
103
- font-weight: font-family.font-weight('regular'),
104
- line-height: 1.375,
105
- letter-spacing: 0,
106
- ) !default;
107
-
108
- /// @type Map
109
- /// @access public
110
- /// @group @carbon/type
111
- $body-compact-02: $body-short-02 !default;
112
-
113
- /// @type Map
114
- /// @access public
115
- /// @group @carbon/type
116
- $body-long-02: (
117
- font-size: scale.type-scale(3),
118
- font-weight: font-family.font-weight('regular'),
119
- line-height: 1.5,
120
- letter-spacing: 0,
121
- ) !default;
122
-
123
- /// @type Map
124
- /// @access public
125
- /// @group @carbon/type
126
- $body-02: $body-long-02 !default;
127
-
128
- /// @type Map
129
- /// @access public
130
- /// @group @carbon/type
131
- $code-01: (
132
- font-family: font-family.font-family('mono'),
133
- font-size: scale.type-scale(1),
134
- font-weight: font-family.font-weight('regular'),
135
- line-height: 1.33333,
136
- letter-spacing: 0.32px,
137
- ) !default;
138
-
139
- /// @type Map
140
- /// @access public
141
- /// @group @carbon/type
142
- $code-02: (
143
- font-family: font-family.font-family('mono'),
144
- font-size: scale.type-scale(2),
145
- font-weight: font-family.font-weight('regular'),
146
- line-height: 1.42857,
147
- letter-spacing: 0.32px,
148
- ) !default;
149
-
150
- /// @type Map
151
- /// @access public
152
- /// @group @carbon/type
153
- $heading-01: (
154
- font-size: scale.type-scale(2),
155
- font-weight: font-family.font-weight('semibold'),
156
- line-height: 1.42857,
157
- letter-spacing: 0.16px,
158
- ) !default;
159
-
160
- /// @type Map
161
- /// @access public
162
- /// @group @carbon/type
163
- $productive-heading-01: (
164
- font-size: scale.type-scale(2),
165
- font-weight: font-family.font-weight('semibold'),
166
- line-height: 1.28572,
167
- letter-spacing: 0.16px,
168
- ) !default;
169
-
170
- /// @type Map
171
- /// @access public
172
- /// @group @carbon/type
173
- $heading-compact-01: $productive-heading-01 !default;
174
-
175
- /// @type Map
176
- /// @access public
177
- /// @group @carbon/type
178
- $heading-02: (
179
- font-size: scale.type-scale(3),
180
- font-weight: font-family.font-weight('semibold'),
181
- line-height: 1.5,
182
- letter-spacing: 0,
183
- ) !default;
184
-
185
- /// @type Map
186
- /// @access public
187
- /// @group @carbon/type
188
- $productive-heading-02: (
189
- font-size: scale.type-scale(3),
190
- font-weight: font-family.font-weight('semibold'),
191
- line-height: 1.375,
192
- letter-spacing: 0,
193
- ) !default;
194
-
195
- /// @type Map
196
- /// @access public
197
- /// @group @carbon/type
198
- $heading-compact-02: $productive-heading-02 !default;
199
-
200
- /// @type Map
201
- /// @access public
202
- /// @group @carbon/type
203
- $productive-heading-03: (
204
- font-size: scale.type-scale(5),
205
- font-weight: font-family.font-weight('regular'),
206
- line-height: 1.4,
207
- letter-spacing: 0,
208
- ) !default;
209
-
210
- /// @type Map
211
- /// @access public
212
- /// @group @carbon/type
213
- $heading-03: $productive-heading-03 !default;
214
-
215
- /// @type Map
216
- /// @access public
217
- /// @group @carbon/type
218
- $productive-heading-04: (
219
- font-size: scale.type-scale(7),
220
- font-weight: font-family.font-weight('regular'),
221
- line-height: 1.28572,
222
- letter-spacing: 0,
223
- ) !default;
224
-
225
- /// @type Map
226
- /// @access public
227
- /// @group @carbon/type
228
- $heading-04: $productive-heading-04 !default;
229
-
230
- /// @type Map
231
- /// @access public
232
- /// @group @carbon/type
233
- $productive-heading-05: (
234
- font-size: scale.type-scale(8),
235
- font-weight: font-family.font-weight('regular'),
236
- line-height: 1.25,
237
- letter-spacing: 0,
238
- ) !default;
239
-
240
- /// @type Map
241
- /// @access public
242
- /// @group @carbon/type
243
- $heading-05: $productive-heading-05 !default;
244
-
245
- /// @type Map
246
- /// @access public
247
- /// @group @carbon/type
248
- $productive-heading-06: (
249
- font-size: scale.type-scale(8),
250
- font-weight: font-family.font-weight('light'),
251
- // Extra digit needed for precision in Chrome
252
- line-height: 1.199,
253
- letter-spacing: 0,
254
- ) !default;
255
-
256
- /// @type Map
257
- /// @access public
258
- /// @group @carbon/type
259
- $heading-06: $productive-heading-06 !default;
260
-
261
- /// @type Map
262
- /// @access public
263
- /// @group @carbon/type
264
- $productive-heading-07: (
265
- font-size: scale.type-scale(10),
266
- font-weight: font-family.font-weight('light'),
267
- line-height: 1.19,
268
- letter-spacing: 0,
269
- ) !default;
270
-
271
- /// @type Map
272
- /// @access public
273
- /// @group @carbon/type
274
- $heading-07: $productive-heading-07 !default;
275
-
276
- /// @type Map
277
- /// @access public
278
- /// @group @carbon/type
279
- $expressive-heading-01: $heading-01 !default;
280
-
281
- /// @type Map
282
- /// @access public
283
- /// @group @carbon/type
284
- $expressive-heading-02: $heading-02 !default;
285
-
286
- /// @type Map
287
- /// @access public
288
- /// @group @carbon/type
289
- $expressive-heading-03: (
290
- font-size: scale.type-scale(5),
291
- font-weight: font-family.font-weight('regular'),
292
- line-height: 1.4,
293
- letter-spacing: 0,
294
- breakpoints: (
295
- xlg: (
296
- font-size: scale.type-scale(5),
297
- line-height: 1.25,
298
- ),
299
- max: (
300
- font-size: scale.type-scale(6),
301
- line-height: 1.334,
302
- ),
303
- ),
304
- ) !default;
305
-
306
- /// @type Map
307
- /// @access public
308
- /// @group @carbon/type
309
- $fluid-heading-03: $expressive-heading-03 !default;
310
-
311
- /// @type Map
312
- /// @access public
313
- /// @group @carbon/type
314
- $expressive-heading-04: (
315
- font-size: scale.type-scale(7),
316
- font-weight: font-family.font-weight('regular'),
317
- line-height: 1.28572,
318
- letter-spacing: 0,
319
- breakpoints: (
320
- xlg: (
321
- font-size: scale.type-scale(7),
322
- line-height: 1.25,
323
- ),
324
- max: (
325
- font-size: scale.type-scale(8),
326
- ),
327
- ),
328
- ) !default;
329
-
330
- /// @type Map
331
- /// @access public
332
- /// @group @carbon/type
333
- $fluid-heading-04: $expressive-heading-04 !default;
334
-
335
- /// @type Map
336
- /// @access public
337
- /// @group @carbon/type
338
- $expressive-heading-05: (
339
- font-size: scale.type-scale(8),
340
- font-weight: font-family.font-weight('regular'),
341
- line-height: 1.25,
342
- letter-spacing: 0,
343
- breakpoints: (
344
- md: (
345
- font-size: scale.type-scale(9),
346
- font-weight: font-family.font-weight('light'),
347
- line-height: 1.22,
348
- ),
349
- lg: (
350
- font-size: scale.type-scale(10),
351
- line-height: 1.19,
352
- ),
353
- xlg: (
354
- font-size: scale.type-scale(11),
355
- line-height: 1.17,
356
- ),
357
- max: (
358
- font-size: scale.type-scale(13),
359
- ),
360
- ),
361
- ) !default;
362
-
363
- /// @type Map
364
- /// @access public
365
- /// @group @carbon/type
366
- $fluid-heading-05: $expressive-heading-05 !default;
367
-
368
- /// @type Map
369
- /// @access public
370
- /// @group @carbon/type
371
- $expressive-heading-06: (
372
- font-size: scale.type-scale(8),
373
- font-weight: font-family.font-weight('semibold'),
374
- line-height: 1.25,
375
- letter-spacing: 0,
376
- breakpoints: (
377
- md: (
378
- font-size: scale.type-scale(9),
379
- line-height: 1.22,
380
- ),
381
- lg: (
382
- font-size: scale.type-scale(10),
383
- line-height: 1.19,
384
- ),
385
- xlg: (
386
- font-size: scale.type-scale(11),
387
- line-height: 1.17,
388
- ),
389
- max: (
390
- font-size: scale.type-scale(13),
391
- ),
392
- ),
393
- ) !default;
394
-
395
- /// @type Map
396
- /// @access public
397
- /// @group @carbon/type
398
- $fluid-heading-06: $expressive-heading-06 !default;
399
-
400
- /// @type Map
401
- /// @access public
402
- /// @group @carbon/type
403
- $expressive-paragraph-01: (
404
- font-size: scale.type-scale(6),
405
- font-weight: font-family.font-weight('light'),
406
- line-height: 1.334,
407
- letter-spacing: 0,
408
- breakpoints: (
409
- lg: (
410
- font-size: scale.type-scale(7),
411
- line-height: 1.28572,
412
- ),
413
- max: (
414
- font-size: scale.type-scale(8),
415
- line-height: 1.25,
416
- ),
417
- ),
418
- );
419
-
420
- /// @type Map
421
- /// @access public
422
- /// @group @carbon/type
423
- $fluid-paragraph-01: $expressive-paragraph-01 !default;
424
-
425
- /// @type Map
426
- /// @access public
427
- /// @group @carbon/type
428
- $quotation-01: (
429
- font-family: font-family.font-family('serif'),
430
- font-size: scale.type-scale(5),
431
- font-weight: font-family.font-weight('regular'),
432
- line-height: 1.3,
433
- letter-spacing: 0,
434
- breakpoints: (
435
- md: (
436
- font-size: scale.type-scale(5),
437
- ),
438
- lg: (
439
- font-size: scale.type-scale(6),
440
- line-height: 1.334,
441
- ),
442
- xlg: (
443
- font-size: scale.type-scale(7),
444
- line-height: 1.28572,
445
- ),
446
- max: (
447
- font-size: scale.type-scale(8),
448
- line-height: 1.25,
449
- ),
450
- ),
451
- ) !default;
452
-
453
- /// @type Map
454
- /// @access public
455
- /// @group @carbon/type
456
- $fluid-quotation-01: $quotation-01 !default;
457
-
458
- /// @type Map
459
- /// @access public
460
- /// @group @carbon/type
461
- $quotation-02: (
462
- font-family: font-family.font-family('serif'),
463
- font-size: scale.type-scale(8),
464
- font-weight: font-family.font-weight('light'),
465
- line-height: 1.25,
466
- letter-spacing: 0,
467
- breakpoints: (
468
- md: (
469
- font-size: scale.type-scale(9),
470
- line-height: 1.22,
471
- ),
472
- lg: (
473
- font-size: scale.type-scale(10),
474
- line-height: 1.19,
475
- ),
476
- xlg: (
477
- font-size: scale.type-scale(11),
478
- line-height: 1.17,
479
- ),
480
- max: (
481
- font-size: scale.type-scale(13),
482
- ),
483
- ),
484
- ) !default;
485
-
486
- /// @type Map
487
- /// @access public
488
- /// @group @carbon/type
489
- $fluid-quotation-02: $quotation-02 !default;
490
-
491
- /// @type Map
492
- /// @access public
493
- /// @group @carbon/type
494
- $display-01: (
495
- font-size: scale.type-scale(10),
496
- font-weight: font-family.font-weight('light'),
497
- line-height: 1.19,
498
- letter-spacing: 0,
499
- breakpoints: (
500
- md: (
501
- font-size: scale.type-scale(10),
502
- ),
503
- lg: (
504
- font-size: scale.type-scale(12),
505
- ),
506
- xlg: (
507
- font-size: scale.type-scale(13),
508
- line-height: 1.17,
509
- ),
510
- max: (
511
- font-size: scale.type-scale(15),
512
- line-height: 1.13,
513
- ),
514
- ),
515
- ) !default;
516
-
517
- /// @type Map
518
- /// @access public
519
- /// @group @carbon/type
520
- $fluid-display-01: $display-01 !default;
521
-
522
- /// @type Map
523
- /// @access public
524
- /// @group @carbon/type
525
- $display-02: (
526
- font-size: scale.type-scale(10),
527
- font-weight: font-family.font-weight('semibold'),
528
- line-height: 1.19,
529
- letter-spacing: 0,
530
- breakpoints: (
531
- md: (
532
- font-size: scale.type-scale(10),
533
- ),
534
- lg: (
535
- font-size: scale.type-scale(12),
536
- ),
537
- xlg: (
538
- font-size: scale.type-scale(13),
539
- line-height: 1.16,
540
- ),
541
- max: (
542
- font-size: scale.type-scale(15),
543
- line-height: 1.13,
544
- ),
545
- ),
546
- ) !default;
547
-
548
- /// @type Map
549
- /// @access public
550
- /// @group @carbon/type
551
- $fluid-display-02: $display-02 !default;
552
-
553
- /// @type Map
554
- /// @access public
555
- /// @group @carbon/type
556
- $display-03: (
557
- font-size: scale.type-scale(10),
558
- font-weight: font-family.font-weight('light'),
559
- line-height: 1.19,
560
- letter-spacing: 0,
561
- breakpoints: (
562
- md: (
563
- font-size: scale.type-scale(14),
564
- line-height: 1.15,
565
- ),
566
- lg: (
567
- font-size: scale.type-scale(17),
568
- line-height: 1.11,
569
- letter-spacing: -0.64px,
570
- ),
571
- xlg: (
572
- font-size: scale.type-scale(20),
573
- line-height: 1.07,
574
- letter-spacing: -0.64px,
575
- ),
576
- max: (
577
- font-size: scale.type-scale(23),
578
- line-height: 1.05,
579
- letter-spacing: -0.96px,
580
- ),
581
- ),
582
- ) !default;
583
-
584
- /// @type Map
585
- /// @access public
586
- /// @group @carbon/type
587
- $fluid-display-03: $display-03 !default;
588
-
589
- /// @type Map
590
- /// @access public
591
- /// @group @carbon/type
592
- $display-04: (
593
- font-size: scale.type-scale(10),
594
- font-weight: font-family.font-weight('semibold'),
595
- line-height: 1.19,
596
- letter-spacing: 0,
597
- breakpoints: (
598
- md: (
599
- font-size: scale.type-scale(14),
600
- line-height: 1.15,
601
- ),
602
- lg: (
603
- font-size: scale.type-scale(17),
604
- line-height: 1.11,
605
- letter-spacing: -0.64px,
606
- ),
607
- xlg: (
608
- font-size: scale.type-scale(20),
609
- line-height: 1.07,
610
- letter-spacing: -0.64px,
611
- ),
612
- max: (
613
- font-size: scale.type-scale(23),
614
- line-height: 1.05,
615
- letter-spacing: -0.96px,
616
- ),
617
- ),
618
- ) !default;
619
-
620
- /// @type Map
621
- /// @access public
622
- /// @group @carbon/type
623
- $fluid-display-04: $display-04 !default;
624
-
625
- /// @type Map
626
- /// @access public
627
- /// @group @carbon/type
628
- $tokens: (
629
- caption-01: $caption-01,
630
- label-01: $label-01,
631
- helper-text-01: $helper-text-01,
632
- body-short-01: $body-short-01,
633
- body-short-02: $body-short-02,
634
- body-long-01: $body-long-01,
635
- body-long-02: $body-long-02,
636
- code-01: $code-01,
637
- code-02: $code-02,
638
- heading-01: $heading-01,
639
- heading-02: $heading-02,
640
- productive-heading-01: $productive-heading-01,
641
- productive-heading-02: $productive-heading-02,
642
- productive-heading-03: $productive-heading-03,
643
- productive-heading-04: $productive-heading-04,
644
- productive-heading-05: $productive-heading-05,
645
- productive-heading-06: $productive-heading-06,
646
- productive-heading-07: $productive-heading-07,
647
- expressive-paragraph-01: $expressive-paragraph-01,
648
- expressive-heading-01: $expressive-heading-01,
649
- expressive-heading-02: $expressive-heading-02,
650
- expressive-heading-03: $expressive-heading-03,
651
- expressive-heading-04: $expressive-heading-04,
652
- expressive-heading-05: $expressive-heading-05,
653
- expressive-heading-06: $expressive-heading-06,
654
- quotation-01: $quotation-01,
655
- quotation-02: $quotation-02,
656
- display-01: $display-01,
657
- display-02: $display-02,
658
- display-03: $display-03,
659
- display-04: $display-04,
660
- // V11 Tokens
661
- legal-01: $legal-01,
662
- legal-02: $legal-02,
663
- body-compact-01: $body-compact-01,
664
- body-compact-02: $body-compact-02,
665
- heading-compact-01: $heading-compact-01,
666
- heading-compact-02: $heading-compact-02,
667
- body-01: $body-01,
668
- body-02: $body-02,
669
- heading-03: $heading-03,
670
- heading-04: $heading-04,
671
- heading-05: $heading-05,
672
- heading-06: $heading-06,
673
- heading-07: $heading-07,
674
- fluid-heading-03: $fluid-heading-03,
675
- fluid-heading-04: $fluid-heading-04,
676
- fluid-heading-05: $fluid-heading-05,
677
- fluid-heading-06: $fluid-heading-06,
678
- fluid-paragraph-01: $fluid-paragraph-01,
679
- fluid-quotation-01: $fluid-quotation-01,
680
- fluid-quotation-02: $fluid-quotation-02,
681
- fluid-display-01: $fluid-display-01,
682
- fluid-display-02: $fluid-display-02,
683
- fluid-display-03: $fluid-display-03,
684
- fluid-display-04: $fluid-display-04,
685
- );
686
-
687
- /// @param {Map} $map
688
- /// @access public
689
- /// @group @carbon/type
690
- @mixin properties($map) {
691
- @each $name, $value in $map {
692
- #{$name}: $value;
693
- }
694
- }
695
-
696
- /// @param {Number} $value - Number with units
697
- /// @return {Number} Without units
698
- /// @access public
699
- /// @group @carbon/type
700
- @function strip-unit($value) {
701
- @return math.div($value, $value * 0 + 1);
702
- }
703
-
704
- /// This helper includes fluid type styles for the given token value. Fluid type
705
- /// means that the `font-size` is computed using `calc()` in order to be
706
- /// determined by the screen size instead of a breakpoint. As a result, fluid
707
- /// styles should be used with caution in fixed width contexts.
708
- ///
709
- /// In addition, we make use of %-based line-heights so that the line-height of
710
- /// each type style is computed correctly due to the dynamic nature of the
711
- /// `font-size`.
712
- ///
713
- /// Most of the logic for this work comes from CSS Tricks:
714
- /// https://css-tricks.com/snippets/css/fluid-typography/
715
- ///
716
- /// @param {Map} $type-styles - The value of a given type token
717
- /// @param {Map} $breakpoints [$grid-breakpoints] - Custom breakpoints to use
718
- /// @access public
719
- /// @group @carbon/type
720
- @mixin fluid-type($type-styles, $breakpoints: gridconfig.$grid-breakpoints) {
721
- // Include the initial styles for the given token by default without any
722
- // media query guard. This includes `font-size` as a fallback in the case
723
- // that a browser does not support `calc()`
724
- @include properties(map.remove($type-styles, breakpoints));
725
- // We also need to include the `sm` styles by default since they don't
726
- // appear in the fluid styles for tokens
727
- @include fluid-type-size($type-styles, sm, $breakpoints);
728
-
729
- // Finally, we need to go through all the breakpoints defined in the type
730
- // token and apply the properties and fluid type size for that given
731
- // breakpoint
732
- @each $name, $values in map.get($type-styles, breakpoints) {
733
- @include grid.breakpoint($name) {
734
- @include properties($values);
735
- @include fluid-type-size($type-styles, $name, $breakpoints);
736
- }
737
- }
738
- }
739
-
740
- /// Computes the fluid `font-size` for a given type style and breakpoint
741
- /// @param {Map} $type-styles - The styles for a given token
742
- /// @param {String} $name - The name of the breakpoint to which we apply the fluid
743
- /// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints for the grid system
744
- /// @access public
745
- /// @group @carbon/type
746
- @mixin fluid-type-size(
747
- $type-styles,
748
- $name,
749
- $breakpoints: gridconfig.$grid-breakpoints
750
- ) {
751
- // Get the information about the breakpoint we're currently working in. Useful
752
- // for getting initial width information
753
- $breakpoint: map.get($breakpoints, $name);
754
-
755
- // Our fluid styles are captured under the 'breakpoints' property in our type
756
- // styles map. These define what values to treat as `max-` variables below
757
- $fluid-sizes: map.get($type-styles, breakpoints);
758
- $fluid-breakpoint: ();
759
- // Special case for `sm` because the styles for small are on the type style
760
- // directly
761
- @if $name == sm {
762
- $fluid-breakpoint: map.remove($type-styles, breakpoints);
763
- } @else {
764
- $fluid-breakpoint: map.get($fluid-sizes, $name);
765
- }
766
-
767
- // Initialize our font-sizes to the default size for the type style
768
- $max-font-size: map.get($type-styles, font-size);
769
- $min-font-size: map.get($type-styles, font-size);
770
- @if map.has-key($fluid-breakpoint, font-size) {
771
- $min-font-size: map.get($fluid-breakpoint, font-size);
772
- }
773
-
774
- // Initialize our min and max width to the width of the current breakpoint
775
- $max-vw: map.get($breakpoint, width);
776
- $min-vw: map.get($breakpoint, width);
777
-
778
- // We can use `breakpoint-next` to see if there is another breakpoint we can
779
- // use to update `max-font-size` and `max-vw` with larger values
780
- $next-breakpoint-available: grid.breakpoint-next($name, $breakpoints);
781
- $next-fluid-breakpoint-name: null;
782
-
783
- // We need to figure out what the next available fluid breakpoint is for our
784
- // given $type-styles. In this loop we try and iterate through breakpoints
785
- // until we either manually set $next-breakpoint-available to null or
786
- // `breakpoint-next` returns null.
787
- @while $next-breakpoint-available {
788
- @if map.has-key($fluid-sizes, $next-breakpoint-available) {
789
- $next-fluid-breakpoint-name: $next-breakpoint-available;
790
- $next-breakpoint-available: null;
791
- } @else {
792
- $next-breakpoint-available: grid.breakpoint-next(
793
- $next-breakpoint-available,
794
- $breakpoints
795
- );
796
- }
797
- }
798
-
799
- // If we have found the next available fluid breakpoint name, then we know
800
- // that we have values that we can use to set max-font-size and max-vw as both
801
- // values derive from the next breakpoint
802
- @if $next-fluid-breakpoint-name {
803
- $next-fluid-breakpoint: map.get($breakpoints, $next-fluid-breakpoint-name);
804
- $max-font-size: map.get(
805
- map.get($fluid-sizes, $next-fluid-breakpoint-name),
806
- font-size
807
- );
808
- $max-vw: map.get($next-fluid-breakpoint, width);
809
-
810
- // prettier-ignore
811
- font-size: calc(#{$min-font-size} +
812
- #{strip-unit($max-font-size - $min-font-size)} *
813
- ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})
814
- );
815
- } @else {
816
- // Otherwise, just default to setting the font size found from the type
817
- // style or the given fluid breakpoint in the type style
818
- font-size: $min-font-size;
819
- }
820
- }
821
-
822
- // TODO move following variable and `custom-property` mixin into shared file for
823
- // both `@carbon/type` and `@carbon/themes`
824
-
825
- /// @access private
826
- /// @group @carbon/type
827
- $custom-property-prefix: 'cds' !default;
828
-
829
- /// @access private
830
- /// @group @carbon/type
831
- @mixin custom-properties($name, $value) {
832
- @each $property, $value in $value {
833
- #{$property}: var(
834
- --#{$custom-property-prefix}-#{$name}-#{$property},
835
- #{$value}
836
- );
837
- }
838
- }
839
-
840
- /// Helper mixin to include the styles for a given token in any selector in your
841
- /// project. Also includes an optional fluid option that will enable fluid
842
- /// styles for the token if they are defined. Fluid styles will cause the
843
- /// token's font-size to be computed based on the viewport size. As a result, use
844
- /// with caution in fixed contexts.
845
- /// @param {String} $name - The name of the token to get the styles for
846
- /// @param {Boolean} $fluid [false] - Specify whether to include fluid styles for the
847
- /// @param {Map} $breakpoints [$grid-breakpoints] - Provide a custom breakpoint map to use
848
- /// @access public
849
- /// @group @carbon/type
850
- @mixin type-style(
851
- $name,
852
- $fluid: false,
853
- $breakpoints: gridconfig.$grid-breakpoints
854
- ) {
855
- @if not map.has-key($tokens, $name) {
856
- @error 'Unable to find a token with the name: `#{$name}`';
857
- }
858
-
859
- $token: map.get($tokens, $name);
860
-
861
- // If $fluid is set to true and the token has breakpoints defined for fluid
862
- // styles, delegate to the fluid-type helper for the given token
863
- @if $fluid == true and map.has-key($token, 'breakpoints') {
864
- @include fluid-type($token, $breakpoints);
865
- } @else {
866
- @if global-variable-exists('feature-flags') and
867
- map.get($feature-flags, 'enable-css-custom-properties')
868
- {
869
- @include custom-properties($name, $token);
870
- } @else {
871
- // Otherwise, we just include all the property declarations directly on the
872
- // selector
873
- @include properties(map.remove($token, 'breakpoints'));
874
- }
875
- }
876
- }