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