@carbon/charts 0.41.48 → 0.41.52
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/CHANGELOG.md +20 -11
- package/build/demo/data/CHART_TYPES.d.ts +93 -0
- package/build/demo/data/bar.d.ts +17 -23
- package/build/demo/data/combo.d.ts +3 -0
- package/build/demo/data/index.d.ts +16 -92
- package/build/demo/data/line.d.ts +3 -77
- package/build/demo/data/scatter.d.ts +0 -18
- package/build/demo/data/wordcloud.d.ts +14 -0
- package/build/src/charts/index.d.ts +1 -0
- package/build/src/charts/wordcloud.d.ts +6 -0
- package/build/src/components/graphs/wordcloud.d.ts +10 -0
- package/build/src/components/index.d.ts +1 -0
- package/build/src/configuration.d.ts +2 -1
- package/build/src/interfaces/charts.d.ts +23 -0
- package/build/src/interfaces/events.d.ts +9 -0
- package/bundle.js +1 -1
- package/charts/index.d.ts +1 -0
- package/charts/index.js +1 -0
- package/charts/index.js.map +1 -1
- package/charts/wordcloud.d.ts +6 -0
- package/charts/wordcloud.js +46 -0
- package/charts/wordcloud.js.map +1 -0
- package/components/essentials/tooltip-axis.js +1 -1
- package/components/essentials/tooltip-axis.js.map +1 -1
- package/components/essentials/tooltip.js +5 -2
- package/components/essentials/tooltip.js.map +1 -1
- package/components/graphs/boxplot.js +2 -2
- package/components/graphs/boxplot.js.map +1 -1
- package/components/graphs/wordcloud.d.ts +10 -0
- package/components/graphs/wordcloud.js +229 -0
- package/components/graphs/wordcloud.js.map +1 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/index.js.map +1 -1
- package/configuration.d.ts +2 -1
- package/configuration.js +22 -0
- package/configuration.js.map +1 -1
- package/demo/data/CHART_TYPES.d.ts +93 -0
- package/demo/data/CHART_TYPES.js +93 -0
- package/demo/data/CHART_TYPES.js.map +1 -0
- package/demo/data/area.js +1 -1
- package/demo/data/area.js.map +1 -1
- package/demo/data/bar.d.ts +17 -23
- package/demo/data/bar.js +60 -68
- package/demo/data/bar.js.map +1 -1
- package/demo/data/boxplot.js +2 -2
- package/demo/data/boxplot.js.map +1 -1
- package/demo/data/bundle.js +1 -1
- package/demo/data/combo.d.ts +3 -0
- package/demo/data/combo.js +3 -0
- package/demo/data/combo.js.map +1 -1
- package/demo/data/index.d.ts +16 -92
- package/demo/data/index.js +404 -512
- package/demo/data/index.js.map +1 -1
- package/demo/data/line.d.ts +3 -77
- package/demo/data/line.js +9 -73
- package/demo/data/line.js.map +1 -1
- package/demo/data/scatter.d.ts +0 -18
- package/demo/data/scatter.js +0 -51
- package/demo/data/scatter.js.map +1 -1
- package/demo/data/wordcloud.d.ts +14 -0
- package/demo/data/wordcloud.js +105 -0
- package/demo/data/wordcloud.js.map +1 -0
- package/demo/styles.css +2827 -28
- package/demo/styles.css.map +1 -1
- package/demo/styles.min.css +1 -1
- package/demo/styles.min.css.map +1 -1
- package/demo/tsconfig.tsbuildinfo +47 -312
- package/interfaces/charts.d.ts +23 -0
- package/interfaces/charts.js.map +1 -1
- package/interfaces/events.d.ts +9 -0
- package/interfaces/events.js +10 -0
- package/interfaces/events.js.map +1 -1
- package/model.js +1 -1
- package/model.js.map +1 -1
- package/package.json +8 -7
- package/styles/_type.scss +4 -2
- package/styles/graphs/_wordcloud.scss +7 -0
- package/styles/graphs/index.scss +1 -0
- package/styles/vendor/@carbon/colors/README.md +4 -3
- package/styles/vendor/@carbon/colors/es/index.js +13 -12
- package/styles/vendor/@carbon/colors/lib/index.js +98 -93
- package/styles/vendor/@carbon/colors/package.json +14 -10
- package/styles/vendor/@carbon/colors/scss/colors.scss +1 -1
- package/styles/vendor/@carbon/colors/scss/index.scss +1 -1
- package/styles/vendor/@carbon/colors/scss/mixins.scss +33 -13
- package/styles/vendor/@carbon/colors/umd/index.js +99 -94
- package/styles/vendor/@carbon/elements/README.md +0 -6
- package/styles/vendor/@carbon/elements/es/index.js +4 -11
- package/styles/vendor/@carbon/elements/lib/index.js +959 -13
- package/styles/vendor/@carbon/elements/package.json +17 -13
- package/styles/vendor/@carbon/elements/scss/colors/colors.scss +1 -1
- package/styles/vendor/@carbon/elements/scss/colors/index.scss +1 -1
- package/styles/vendor/@carbon/elements/scss/colors/mixins.scss +33 -13
- package/styles/vendor/@carbon/elements/scss/grid/_inlined/_mixins.scss +82 -22
- package/styles/vendor/@carbon/elements/scss/grid/_mixins.scss +82 -22
- package/styles/vendor/@carbon/elements/scss/grid/modules/_breakpoint.scss +266 -0
- package/styles/vendor/@carbon/{themes/node_modules/@carbon/colors/scss/colors.scss → elements/scss/grid/modules/_config.scss} +6 -6
- package/styles/vendor/@carbon/elements/scss/grid/modules/_css-grid.scss +350 -0
- package/styles/vendor/@carbon/elements/scss/grid/modules/_mixins.scss +323 -0
- package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/_breakpoint.scss +8 -3
- package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/_breakpoint.scss +232 -0
- package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/_convert.scss +40 -0
- package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/_spacing.scss +9 -0
- package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/_utilities.scss +41 -0
- package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/generated/_fluid-spacing.scss +37 -0
- package/styles/vendor/@carbon/elements/scss/grid/vendor/@carbon/layout/modules/generated/_spacing.scss +85 -0
- package/styles/vendor/@carbon/elements/scss/layout/_breakpoint.scss +8 -3
- package/styles/vendor/@carbon/elements/scss/layout/modules/_breakpoint.scss +232 -0
- package/styles/vendor/@carbon/elements/scss/layout/modules/_convert.scss +40 -0
- package/styles/vendor/@carbon/elements/scss/layout/modules/_spacing.scss +9 -0
- package/styles/vendor/@carbon/elements/scss/layout/modules/_utilities.scss +41 -0
- package/styles/vendor/@carbon/elements/scss/layout/modules/generated/_fluid-spacing.scss +37 -0
- package/styles/vendor/@carbon/elements/scss/layout/modules/generated/_spacing.scss +85 -0
- package/styles/vendor/@carbon/elements/scss/motion/motion.scss +24 -0
- package/styles/vendor/@carbon/elements/scss/themes/generated/_mixins.scss +643 -138
- package/styles/vendor/@carbon/elements/scss/themes/generated/_themes.scss +154 -77
- package/styles/vendor/@carbon/elements/scss/themes/generated/_tokens.scss +157 -75
- package/styles/vendor/@carbon/elements/scss/themes/modules/_theme.scss +50 -0
- package/styles/vendor/@carbon/elements/scss/themes/modules/_themes.scss +8 -0
- package/styles/vendor/@carbon/elements/scss/themes/modules/_utilities.scss +18 -0
- package/styles/vendor/@carbon/elements/scss/themes/modules/generated/_themes.scss +247 -0
- package/styles/vendor/@carbon/elements/scss/type/_font-family.scss +2 -2
- package/styles/vendor/@carbon/elements/scss/type/_inlined/_font-family.scss +2 -2
- package/styles/vendor/@carbon/elements/scss/type/_inlined/_reset.scss +9 -3
- package/styles/vendor/@carbon/elements/scss/type/_inlined/_scale.scss +2 -2
- package/styles/vendor/@carbon/elements/scss/type/_inlined/_styles.scss +60 -57
- package/styles/vendor/@carbon/elements/scss/type/_inlined/font-face/_mono.scss +72 -72
- package/styles/vendor/@carbon/elements/scss/type/_inlined/font-face/_sans-condensed.scss +302 -0
- package/styles/vendor/@carbon/elements/scss/type/_inlined/font-face/_sans.scss +84 -84
- package/styles/vendor/@carbon/elements/scss/type/_inlined/font-face/_serif.scss +72 -72
- package/styles/vendor/@carbon/elements/scss/type/_reset.scss +9 -3
- package/styles/vendor/@carbon/elements/scss/type/_scale.scss +2 -2
- package/styles/vendor/@carbon/elements/scss/type/_styles.scss +60 -57
- package/styles/vendor/@carbon/elements/scss/type/font-face/_mono.scss +72 -72
- package/styles/vendor/@carbon/elements/scss/type/font-face/_sans-condensed.scss +302 -0
- package/styles/vendor/@carbon/elements/scss/type/font-face/_sans.scss +84 -84
- package/styles/vendor/@carbon/elements/scss/type/font-face/_serif.scss +72 -72
- package/styles/vendor/@carbon/elements/scss/type/modules/_classes.scss +42 -0
- package/styles/vendor/@carbon/elements/scss/type/modules/_font-family.scss +70 -0
- package/styles/vendor/@carbon/elements/scss/type/modules/_prefix.scss +11 -0
- package/styles/vendor/@carbon/elements/scss/type/modules/_reset.scss +92 -0
- package/styles/vendor/@carbon/elements/scss/type/modules/_scale.scss +56 -0
- package/styles/vendor/@carbon/elements/scss/type/modules/_styles.scss +713 -0
- package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/_breakpoint.scss +8 -3
- package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/_breakpoint.scss +232 -0
- package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/_convert.scss +40 -0
- package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/_spacing.scss +9 -0
- package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/_utilities.scss +41 -0
- package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/generated/_fluid-spacing.scss +37 -0
- package/styles/vendor/@carbon/elements/scss/type/vendor/@carbon/layout/modules/generated/_spacing.scss +85 -0
- package/styles/vendor/@carbon/elements/src/__tests__/PublicAPI-test.js +12 -0
- package/styles/vendor/@carbon/elements/src/__tests__/__snapshots__/PublicAPI-test.js.snap +306 -0
- package/styles/vendor/@carbon/elements/src/index.js +166 -4
- package/styles/vendor/@carbon/elements/umd/index.js +961 -17
- package/styles/vendor/@carbon/layout/README.md +0 -6
- package/styles/vendor/@carbon/layout/es/index.js +1 -1
- package/styles/vendor/@carbon/{themes/node_modules/@carbon/colors/scss → layout}/index.scss +5 -6
- package/styles/vendor/@carbon/layout/lib/index.js +30 -30
- package/styles/vendor/@carbon/layout/package.json +14 -10
- package/styles/vendor/@carbon/layout/scss/_breakpoint.scss +8 -3
- package/styles/vendor/@carbon/layout/scss/modules/_breakpoint.scss +232 -0
- package/styles/vendor/@carbon/layout/scss/modules/_convert.scss +40 -0
- package/styles/vendor/@carbon/layout/scss/modules/_spacing.scss +9 -0
- package/styles/vendor/@carbon/layout/scss/modules/_utilities.scss +41 -0
- package/styles/vendor/@carbon/layout/scss/modules/generated/_fluid-spacing.scss +37 -0
- package/styles/vendor/@carbon/layout/scss/modules/generated/_spacing.scss +85 -0
- package/styles/vendor/@carbon/layout/umd/index.js +31 -31
- package/styles/vendor/@carbon/motion/README.md +0 -6
- package/styles/vendor/@carbon/motion/es/index.js +8 -1
- package/styles/vendor/@carbon/motion/index.scss +56 -0
- package/styles/vendor/@carbon/motion/lib/index.js +14 -0
- package/styles/vendor/@carbon/motion/package.json +10 -6
- package/styles/vendor/@carbon/motion/scss/motion.scss +24 -0
- package/styles/vendor/@carbon/motion/src/index.js +16 -0
- package/styles/vendor/@carbon/motion/umd/index.js +15 -1
- package/styles/vendor/@carbon/themes/README.md +5 -4
- package/styles/vendor/@carbon/themes/es/index.js +719 -57
- package/styles/vendor/@carbon/themes/index.scss +9 -0
- package/styles/vendor/@carbon/themes/lib/index.js +1297 -251
- package/styles/vendor/@carbon/themes/metadata.yml +3 -0
- package/styles/vendor/@carbon/themes/package.json +23 -14
- package/styles/vendor/@carbon/themes/scss/_mixins.scss +27 -146
- package/styles/vendor/@carbon/themes/scss/_theme-maps.scss +3 -263
- package/styles/vendor/@carbon/themes/scss/_tokens.scss +2 -297
- package/styles/vendor/@carbon/themes/scss/generated/_mixins.scss +1851 -0
- package/styles/vendor/@carbon/themes/scss/generated/_themes.scss +1534 -0
- package/styles/vendor/@carbon/themes/scss/generated/_tokens.scss +1757 -0
- package/styles/vendor/@carbon/themes/scss/modules/_theme.scss +50 -0
- package/styles/vendor/@carbon/themes/scss/modules/_themes.scss +8 -0
- package/styles/vendor/@carbon/themes/scss/modules/_utilities.scss +18 -0
- package/styles/vendor/@carbon/themes/scss/modules/generated/_themes.scss +247 -0
- package/styles/vendor/@carbon/themes/scss/themes.scss +3 -2
- package/styles/vendor/@carbon/themes/src/g10.js +97 -5
- package/styles/vendor/@carbon/themes/src/g100.js +96 -4
- package/styles/vendor/@carbon/themes/src/g90.js +98 -6
- package/styles/vendor/@carbon/themes/src/index.js +5 -3
- package/styles/vendor/@carbon/themes/src/tokens.js +112 -2
- package/styles/vendor/@carbon/themes/src/tools.js +25 -0
- package/styles/vendor/@carbon/themes/src/v9.js +181 -0
- package/styles/vendor/@carbon/themes/src/white.js +98 -3
- package/styles/vendor/@carbon/themes/umd/index.js +1297 -254
- package/styles/vendor/@carbon/type/README.md +0 -6
- package/styles/vendor/@carbon/type/es/index.js +111 -82
- package/styles/vendor/@carbon/type/lib/index.js +132 -103
- package/styles/vendor/@carbon/type/package.json +12 -8
- package/styles/vendor/@carbon/type/scss/_font-family.scss +2 -2
- package/styles/vendor/@carbon/type/scss/_inlined/_font-family.scss +2 -2
- package/styles/vendor/@carbon/type/scss/_inlined/_reset.scss +9 -3
- package/styles/vendor/@carbon/type/scss/_inlined/_scale.scss +2 -2
- package/styles/vendor/@carbon/type/scss/_inlined/_styles.scss +60 -57
- package/styles/vendor/@carbon/type/scss/_inlined/font-face/_mono.scss +72 -72
- package/styles/vendor/@carbon/type/scss/_inlined/font-face/_sans-condensed.scss +302 -0
- package/styles/vendor/@carbon/type/scss/_inlined/font-face/_sans.scss +84 -84
- package/styles/vendor/@carbon/type/scss/_inlined/font-face/_serif.scss +72 -72
- package/styles/vendor/@carbon/type/scss/_reset.scss +9 -3
- package/styles/vendor/@carbon/type/scss/_scale.scss +2 -2
- package/styles/vendor/@carbon/type/scss/_styles.scss +60 -57
- package/styles/vendor/@carbon/type/scss/font-face/_mono.scss +72 -72
- package/styles/vendor/@carbon/type/scss/font-face/_sans-condensed.scss +302 -0
- package/styles/vendor/@carbon/type/scss/font-face/_sans.scss +84 -84
- package/styles/vendor/@carbon/type/scss/font-face/_serif.scss +72 -72
- package/styles/vendor/@carbon/type/scss/modules/_classes.scss +42 -0
- package/styles/vendor/@carbon/type/scss/modules/_font-family.scss +70 -0
- package/styles/vendor/@carbon/type/scss/modules/_prefix.scss +11 -0
- package/styles/vendor/@carbon/type/scss/modules/_reset.scss +92 -0
- package/styles/vendor/@carbon/type/scss/modules/_scale.scss +56 -0
- package/styles/vendor/@carbon/type/scss/modules/_styles.scss +713 -0
- package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/_breakpoint.scss +8 -3
- package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/_breakpoint.scss +232 -0
- package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/_convert.scss +40 -0
- package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/_spacing.scss +9 -0
- package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/_utilities.scss +41 -0
- package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/generated/_fluid-spacing.scss +37 -0
- package/styles/vendor/@carbon/type/scss/vendor/@carbon/layout/modules/generated/_spacing.scss +85 -0
- package/styles/vendor/@carbon/type/src/__tests__/__snapshots__/styles-test.js.snap +32 -34
- package/styles/vendor/@carbon/type/src/__tests__/exports-test.js +1 -1
- package/styles/vendor/@carbon/type/src/__tests__/fluid-test.js +26 -26
- package/styles/vendor/@carbon/type/src/__tests__/styles-test.js +1 -1
- package/styles/vendor/@carbon/type/src/__tests__/tokens-test.js +2 -2
- package/styles/vendor/@carbon/type/src/fluid.js +1 -1
- package/styles/vendor/@carbon/type/src/index.js +1 -1
- package/styles/vendor/@carbon/type/src/styles.js +65 -64
- package/styles/vendor/@carbon/type/src/tokens.js +64 -31
- package/styles/vendor/@carbon/type/umd/index.js +134 -105
- package/styles-g10.css +570 -2
- package/styles-g10.css.map +1 -1
- package/styles-g10.min.css +1 -1
- package/styles-g10.min.css.map +1 -1
- package/styles-g100.css +574 -6
- package/styles-g100.css.map +1 -1
- package/styles-g100.min.css +1 -1
- package/styles-g100.min.css.map +1 -1
- package/styles-g90.css +574 -6
- package/styles-g90.css.map +1 -1
- package/styles-g90.min.css +1 -1
- package/styles-g90.min.css.map +1 -1
- package/styles.css +570 -2
- package/styles.css.map +1 -1
- package/styles.min.css +1 -1
- package/styles.min.css.map +1 -1
- package/tools.js +1 -1
- package/tools.js.map +1 -1
- package/tsconfig.tsbuildinfo +67 -17
- package/styles/vendor/@carbon/layout/docs/sass.md +0 -1899
- package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/LICENSE +0 -201
- package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/README.md +0 -154
- package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/es/index.js +0 -287
- package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/lib/index.js +0 -410
- package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/package.json +0 -51
- package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/scss/mixins.scss +0 -646
- package/styles/vendor/@carbon/themes/node_modules/@carbon/colors/umd/index.js +0 -416
|
@@ -0,0 +1,713 @@
|
|
|
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
|
+
@use 'sass:map';
|
|
9
|
+
@use '@carbon/layout';
|
|
10
|
+
@use 'font-family';
|
|
11
|
+
@use 'scale';
|
|
12
|
+
|
|
13
|
+
/// @type Map
|
|
14
|
+
/// @access public
|
|
15
|
+
/// @group @carbon/type
|
|
16
|
+
$caption-01: (
|
|
17
|
+
font-size: scale.type-scale(1),
|
|
18
|
+
font-weight: font-family.font-weight('regular'),
|
|
19
|
+
line-height: 1.34,
|
|
20
|
+
letter-spacing: 0.32px,
|
|
21
|
+
) !default;
|
|
22
|
+
|
|
23
|
+
/// @type Map
|
|
24
|
+
/// @access public
|
|
25
|
+
/// @group @carbon/type
|
|
26
|
+
$label-01: (
|
|
27
|
+
font-size: scale.type-scale(1),
|
|
28
|
+
font-weight: font-family.font-weight('regular'),
|
|
29
|
+
line-height: 1.34,
|
|
30
|
+
letter-spacing: 0.32px,
|
|
31
|
+
) !default;
|
|
32
|
+
|
|
33
|
+
/// @type Map
|
|
34
|
+
/// @access public
|
|
35
|
+
/// @group @carbon/type
|
|
36
|
+
$helper-text-01: (
|
|
37
|
+
font-size: scale.type-scale(1),
|
|
38
|
+
line-height: 1.34,
|
|
39
|
+
letter-spacing: 0.32px,
|
|
40
|
+
) !default;
|
|
41
|
+
|
|
42
|
+
/// @type Map
|
|
43
|
+
/// @access public
|
|
44
|
+
/// @group @carbon/type
|
|
45
|
+
$body-short-01: (
|
|
46
|
+
font-size: scale.type-scale(2),
|
|
47
|
+
font-weight: font-family.font-weight('regular'),
|
|
48
|
+
line-height: 1.29,
|
|
49
|
+
letter-spacing: 0.16px,
|
|
50
|
+
) !default;
|
|
51
|
+
|
|
52
|
+
/// @type Map
|
|
53
|
+
/// @access public
|
|
54
|
+
/// @group @carbon/type
|
|
55
|
+
$body-long-01: (
|
|
56
|
+
font-size: scale.type-scale(2),
|
|
57
|
+
font-weight: font-family.font-weight('regular'),
|
|
58
|
+
line-height: 1.43,
|
|
59
|
+
letter-spacing: 0.16px,
|
|
60
|
+
) !default;
|
|
61
|
+
|
|
62
|
+
/// @type Map
|
|
63
|
+
/// @access public
|
|
64
|
+
/// @group @carbon/type
|
|
65
|
+
$body-short-02: (
|
|
66
|
+
font-size: scale.type-scale(3),
|
|
67
|
+
font-weight: font-family.font-weight('regular'),
|
|
68
|
+
line-height: 1.375,
|
|
69
|
+
letter-spacing: 0,
|
|
70
|
+
) !default;
|
|
71
|
+
|
|
72
|
+
/// @type Map
|
|
73
|
+
/// @access public
|
|
74
|
+
/// @group @carbon/type
|
|
75
|
+
$body-long-02: (
|
|
76
|
+
font-size: scale.type-scale(3),
|
|
77
|
+
font-weight: font-family.font-weight('regular'),
|
|
78
|
+
line-height: 1.5,
|
|
79
|
+
letter-spacing: 0,
|
|
80
|
+
) !default;
|
|
81
|
+
|
|
82
|
+
/// @type Map
|
|
83
|
+
/// @access public
|
|
84
|
+
/// @group @carbon/type
|
|
85
|
+
$code-01: (
|
|
86
|
+
font-family: font-family.font-family('mono'),
|
|
87
|
+
font-size: scale.type-scale(1),
|
|
88
|
+
font-weight: font-family.font-weight('regular'),
|
|
89
|
+
line-height: 1.34,
|
|
90
|
+
letter-spacing: 0.32px,
|
|
91
|
+
) !default;
|
|
92
|
+
|
|
93
|
+
/// @type Map
|
|
94
|
+
/// @access public
|
|
95
|
+
/// @group @carbon/type
|
|
96
|
+
$code-02: (
|
|
97
|
+
font-family: font-family.font-family('mono'),
|
|
98
|
+
font-size: scale.type-scale(2),
|
|
99
|
+
font-weight: font-family.font-weight('regular'),
|
|
100
|
+
line-height: 1.43,
|
|
101
|
+
letter-spacing: 0.32px,
|
|
102
|
+
) !default;
|
|
103
|
+
|
|
104
|
+
/// @type Map
|
|
105
|
+
/// @access public
|
|
106
|
+
/// @group @carbon/type
|
|
107
|
+
$heading-01: (
|
|
108
|
+
font-size: scale.type-scale(2),
|
|
109
|
+
font-weight: font-family.font-weight('semibold'),
|
|
110
|
+
line-height: 1.29,
|
|
111
|
+
letter-spacing: 0.16px,
|
|
112
|
+
) !default;
|
|
113
|
+
|
|
114
|
+
/// @type Map
|
|
115
|
+
/// @access public
|
|
116
|
+
/// @group @carbon/type
|
|
117
|
+
$productive-heading-01: $heading-01 !default;
|
|
118
|
+
|
|
119
|
+
/// @type Map
|
|
120
|
+
/// @access public
|
|
121
|
+
/// @group @carbon/type
|
|
122
|
+
$heading-02: (
|
|
123
|
+
font-size: scale.type-scale(3),
|
|
124
|
+
font-weight: font-family.font-weight('semibold'),
|
|
125
|
+
line-height: 1.375,
|
|
126
|
+
letter-spacing: 0,
|
|
127
|
+
) !default;
|
|
128
|
+
|
|
129
|
+
/// @type Map
|
|
130
|
+
/// @access public
|
|
131
|
+
/// @group @carbon/type
|
|
132
|
+
$productive-heading-02: $heading-02 !default;
|
|
133
|
+
|
|
134
|
+
/// @type Map
|
|
135
|
+
/// @access public
|
|
136
|
+
/// @group @carbon/type
|
|
137
|
+
$productive-heading-03: (
|
|
138
|
+
font-size: scale.type-scale(5),
|
|
139
|
+
font-weight: font-family.font-weight('regular'),
|
|
140
|
+
line-height: 1.4,
|
|
141
|
+
letter-spacing: 0,
|
|
142
|
+
) !default;
|
|
143
|
+
|
|
144
|
+
/// @type Map
|
|
145
|
+
/// @access public
|
|
146
|
+
/// @group @carbon/type
|
|
147
|
+
$productive-heading-04: (
|
|
148
|
+
font-size: scale.type-scale(7),
|
|
149
|
+
font-weight: font-family.font-weight('regular'),
|
|
150
|
+
line-height: 1.29,
|
|
151
|
+
letter-spacing: 0,
|
|
152
|
+
) !default;
|
|
153
|
+
|
|
154
|
+
/// @type Map
|
|
155
|
+
/// @access public
|
|
156
|
+
/// @group @carbon/type
|
|
157
|
+
$productive-heading-05: (
|
|
158
|
+
font-size: scale.type-scale(8),
|
|
159
|
+
font-weight: font-family.font-weight('regular'),
|
|
160
|
+
line-height: 1.25,
|
|
161
|
+
letter-spacing: 0,
|
|
162
|
+
) !default;
|
|
163
|
+
|
|
164
|
+
/// @type Map
|
|
165
|
+
/// @access public
|
|
166
|
+
/// @group @carbon/type
|
|
167
|
+
$productive-heading-06: (
|
|
168
|
+
font-size: scale.type-scale(8),
|
|
169
|
+
font-weight: font-family.font-weight('light'),
|
|
170
|
+
// Extra digit needed for precision in Chrome
|
|
171
|
+
line-height: 1.199,
|
|
172
|
+
letter-spacing: 0,
|
|
173
|
+
) !default;
|
|
174
|
+
|
|
175
|
+
/// @type Map
|
|
176
|
+
/// @access public
|
|
177
|
+
/// @group @carbon/type
|
|
178
|
+
$productive-heading-07: (
|
|
179
|
+
font-size: scale.type-scale(10),
|
|
180
|
+
font-weight: font-family.font-weight('light'),
|
|
181
|
+
line-height: 1.19,
|
|
182
|
+
letter-spacing: 0,
|
|
183
|
+
) !default;
|
|
184
|
+
|
|
185
|
+
/// @type Map
|
|
186
|
+
/// @access public
|
|
187
|
+
/// @group @carbon/type
|
|
188
|
+
$expressive-heading-01: map.merge(
|
|
189
|
+
$heading-01,
|
|
190
|
+
(
|
|
191
|
+
line-height: 1.25,
|
|
192
|
+
)
|
|
193
|
+
) !default;
|
|
194
|
+
|
|
195
|
+
/// @type Map
|
|
196
|
+
/// @access public
|
|
197
|
+
/// @group @carbon/type
|
|
198
|
+
$expressive-heading-02: map.merge(
|
|
199
|
+
$heading-02,
|
|
200
|
+
(
|
|
201
|
+
line-height: 1.5,
|
|
202
|
+
)
|
|
203
|
+
) !default;
|
|
204
|
+
|
|
205
|
+
/// @type Map
|
|
206
|
+
/// @access public
|
|
207
|
+
/// @group @carbon/type
|
|
208
|
+
$expressive-heading-03: (
|
|
209
|
+
font-size: scale.type-scale(5),
|
|
210
|
+
font-weight: font-family.font-weight('regular'),
|
|
211
|
+
line-height: 1.4,
|
|
212
|
+
letter-spacing: 0,
|
|
213
|
+
breakpoints: (
|
|
214
|
+
xlg: (
|
|
215
|
+
font-size: scale.type-scale(5),
|
|
216
|
+
line-height: 1.25,
|
|
217
|
+
),
|
|
218
|
+
max: (
|
|
219
|
+
font-size: scale.type-scale(6),
|
|
220
|
+
line-height: 1.334,
|
|
221
|
+
),
|
|
222
|
+
),
|
|
223
|
+
) !default;
|
|
224
|
+
|
|
225
|
+
/// @type Map
|
|
226
|
+
/// @access public
|
|
227
|
+
/// @group @carbon/type
|
|
228
|
+
$expressive-heading-04: (
|
|
229
|
+
font-size: scale.type-scale(7),
|
|
230
|
+
font-weight: font-family.font-weight('regular'),
|
|
231
|
+
line-height: 1.29,
|
|
232
|
+
letter-spacing: 0,
|
|
233
|
+
breakpoints: (
|
|
234
|
+
xlg: (
|
|
235
|
+
font-size: scale.type-scale(7),
|
|
236
|
+
line-height: 1.25,
|
|
237
|
+
),
|
|
238
|
+
max: (
|
|
239
|
+
font-size: scale.type-scale(8),
|
|
240
|
+
),
|
|
241
|
+
),
|
|
242
|
+
) !default;
|
|
243
|
+
|
|
244
|
+
/// @type Map
|
|
245
|
+
/// @access public
|
|
246
|
+
/// @group @carbon/type
|
|
247
|
+
$expressive-heading-05: (
|
|
248
|
+
font-size: scale.type-scale(8),
|
|
249
|
+
font-weight: font-family.font-weight('regular'),
|
|
250
|
+
line-height: 1.25,
|
|
251
|
+
letter-spacing: 0,
|
|
252
|
+
breakpoints: (
|
|
253
|
+
md: (
|
|
254
|
+
font-size: scale.type-scale(9),
|
|
255
|
+
font-weight: font-family.font-weight('light'),
|
|
256
|
+
line-height: 1.22,
|
|
257
|
+
),
|
|
258
|
+
lg: (
|
|
259
|
+
font-size: scale.type-scale(10),
|
|
260
|
+
line-height: 1.19,
|
|
261
|
+
),
|
|
262
|
+
xlg: (
|
|
263
|
+
font-size: scale.type-scale(11),
|
|
264
|
+
line-height: 1.17,
|
|
265
|
+
),
|
|
266
|
+
max: (
|
|
267
|
+
font-size: scale.type-scale(13),
|
|
268
|
+
),
|
|
269
|
+
),
|
|
270
|
+
) !default;
|
|
271
|
+
|
|
272
|
+
/// @type Map
|
|
273
|
+
/// @access public
|
|
274
|
+
/// @group @carbon/type
|
|
275
|
+
$expressive-heading-06: (
|
|
276
|
+
font-size: scale.type-scale(8),
|
|
277
|
+
font-weight: font-family.font-weight('semibold'),
|
|
278
|
+
line-height: 1.25,
|
|
279
|
+
letter-spacing: 0,
|
|
280
|
+
breakpoints: (
|
|
281
|
+
md: (
|
|
282
|
+
font-size: scale.type-scale(9),
|
|
283
|
+
line-height: 1.22,
|
|
284
|
+
),
|
|
285
|
+
lg: (
|
|
286
|
+
font-size: scale.type-scale(10),
|
|
287
|
+
line-height: 1.19,
|
|
288
|
+
),
|
|
289
|
+
xlg: (
|
|
290
|
+
font-size: scale.type-scale(11),
|
|
291
|
+
line-height: 1.17,
|
|
292
|
+
),
|
|
293
|
+
max: (
|
|
294
|
+
font-size: scale.type-scale(13),
|
|
295
|
+
),
|
|
296
|
+
),
|
|
297
|
+
) !default;
|
|
298
|
+
|
|
299
|
+
/// @type Map
|
|
300
|
+
/// @access public
|
|
301
|
+
/// @group @carbon/type
|
|
302
|
+
$expressive-paragraph-01: (
|
|
303
|
+
font-size: scale.type-scale(6),
|
|
304
|
+
font-weight: font-family.font-weight('light'),
|
|
305
|
+
line-height: 1.334,
|
|
306
|
+
letter-spacing: 0,
|
|
307
|
+
breakpoints: (
|
|
308
|
+
lg: (
|
|
309
|
+
font-size: scale.type-scale(7),
|
|
310
|
+
line-height: 1.29,
|
|
311
|
+
),
|
|
312
|
+
max: (
|
|
313
|
+
font-size: scale.type-scale(8),
|
|
314
|
+
line-height: 1.25,
|
|
315
|
+
),
|
|
316
|
+
),
|
|
317
|
+
);
|
|
318
|
+
|
|
319
|
+
/// @type Map
|
|
320
|
+
/// @access public
|
|
321
|
+
/// @group @carbon/type
|
|
322
|
+
$quotation-01: (
|
|
323
|
+
font-size: scale.type-scale(5),
|
|
324
|
+
font-weight: font-family.font-weight('regular'),
|
|
325
|
+
line-height: 1.3,
|
|
326
|
+
letter-spacing: 0,
|
|
327
|
+
breakpoints: (
|
|
328
|
+
md: (
|
|
329
|
+
font-size: scale.type-scale(5),
|
|
330
|
+
),
|
|
331
|
+
lg: (
|
|
332
|
+
font-size: scale.type-scale(6),
|
|
333
|
+
line-height: 1.334,
|
|
334
|
+
),
|
|
335
|
+
xlg: (
|
|
336
|
+
font-size: scale.type-scale(7),
|
|
337
|
+
line-height: 1.29,
|
|
338
|
+
),
|
|
339
|
+
max: (
|
|
340
|
+
font-size: scale.type-scale(8),
|
|
341
|
+
line-height: 1.25,
|
|
342
|
+
),
|
|
343
|
+
),
|
|
344
|
+
) !default;
|
|
345
|
+
|
|
346
|
+
/// @type Map
|
|
347
|
+
/// @access public
|
|
348
|
+
/// @group @carbon/type
|
|
349
|
+
$quotation-02: (
|
|
350
|
+
font-size: scale.type-scale(8),
|
|
351
|
+
font-weight: font-family.font-weight('light'),
|
|
352
|
+
line-height: 1.25,
|
|
353
|
+
letter-spacing: 0,
|
|
354
|
+
breakpoints: (
|
|
355
|
+
md: (
|
|
356
|
+
font-size: scale.type-scale(9),
|
|
357
|
+
line-height: 1.22,
|
|
358
|
+
),
|
|
359
|
+
lg: (
|
|
360
|
+
font-size: scale.type-scale(10),
|
|
361
|
+
line-height: 1.19,
|
|
362
|
+
),
|
|
363
|
+
xlg: (
|
|
364
|
+
font-size: scale.type-scale(11),
|
|
365
|
+
line-height: 1.17,
|
|
366
|
+
),
|
|
367
|
+
max: (
|
|
368
|
+
font-size: scale.type-scale(13),
|
|
369
|
+
),
|
|
370
|
+
),
|
|
371
|
+
) !default;
|
|
372
|
+
|
|
373
|
+
/// @type Map
|
|
374
|
+
/// @access public
|
|
375
|
+
/// @group @carbon/type
|
|
376
|
+
$display-01: (
|
|
377
|
+
font-size: scale.type-scale(10),
|
|
378
|
+
font-weight: font-family.font-weight('light'),
|
|
379
|
+
line-height: 1.19,
|
|
380
|
+
letter-spacing: 0,
|
|
381
|
+
breakpoints: (
|
|
382
|
+
md: (
|
|
383
|
+
font-size: scale.type-scale(10),
|
|
384
|
+
),
|
|
385
|
+
lg: (
|
|
386
|
+
font-size: scale.type-scale(12),
|
|
387
|
+
),
|
|
388
|
+
xlg: (
|
|
389
|
+
font-size: scale.type-scale(13),
|
|
390
|
+
line-height: 1.17,
|
|
391
|
+
),
|
|
392
|
+
max: (
|
|
393
|
+
font-size: scale.type-scale(15),
|
|
394
|
+
line-height: 1.13,
|
|
395
|
+
),
|
|
396
|
+
),
|
|
397
|
+
) !default;
|
|
398
|
+
|
|
399
|
+
/// @type Map
|
|
400
|
+
/// @access public
|
|
401
|
+
/// @group @carbon/type
|
|
402
|
+
$display-02: (
|
|
403
|
+
font-size: scale.type-scale(10),
|
|
404
|
+
font-weight: font-family.font-weight('semibold'),
|
|
405
|
+
line-height: 1.19,
|
|
406
|
+
letter-spacing: 0,
|
|
407
|
+
breakpoints: (
|
|
408
|
+
md: (
|
|
409
|
+
font-size: scale.type-scale(10),
|
|
410
|
+
),
|
|
411
|
+
lg: (
|
|
412
|
+
font-size: scale.type-scale(12),
|
|
413
|
+
),
|
|
414
|
+
xlg: (
|
|
415
|
+
font-size: scale.type-scale(13),
|
|
416
|
+
line-height: 1.16,
|
|
417
|
+
),
|
|
418
|
+
max: (
|
|
419
|
+
font-size: scale.type-scale(15),
|
|
420
|
+
line-height: 1.13,
|
|
421
|
+
),
|
|
422
|
+
),
|
|
423
|
+
) !default;
|
|
424
|
+
|
|
425
|
+
/// @type Map
|
|
426
|
+
/// @access public
|
|
427
|
+
/// @group @carbon/type
|
|
428
|
+
$display-03: (
|
|
429
|
+
font-size: scale.type-scale(10),
|
|
430
|
+
font-weight: font-family.font-weight('light'),
|
|
431
|
+
line-height: 1.19,
|
|
432
|
+
letter-spacing: 0,
|
|
433
|
+
breakpoints: (
|
|
434
|
+
md: (
|
|
435
|
+
font-size: scale.type-scale(14),
|
|
436
|
+
line-height: 1.15,
|
|
437
|
+
),
|
|
438
|
+
lg: (
|
|
439
|
+
font-size: scale.type-scale(17),
|
|
440
|
+
line-height: 1.11,
|
|
441
|
+
letter-spacing: -0.64px,
|
|
442
|
+
),
|
|
443
|
+
xlg: (
|
|
444
|
+
font-size: scale.type-scale(20),
|
|
445
|
+
line-height: 1.07,
|
|
446
|
+
letter-spacing: -0.64px,
|
|
447
|
+
),
|
|
448
|
+
max: (
|
|
449
|
+
font-size: scale.type-scale(23),
|
|
450
|
+
line-height: 1.05,
|
|
451
|
+
letter-spacing: -0.96px,
|
|
452
|
+
),
|
|
453
|
+
),
|
|
454
|
+
) !default;
|
|
455
|
+
|
|
456
|
+
/// @type Map
|
|
457
|
+
/// @access public
|
|
458
|
+
/// @group @carbon/type
|
|
459
|
+
$display-04: (
|
|
460
|
+
font-size: scale.type-scale(10),
|
|
461
|
+
font-weight: font-family.font-weight('semibold'),
|
|
462
|
+
line-height: 1.19,
|
|
463
|
+
letter-spacing: 0,
|
|
464
|
+
breakpoints: (
|
|
465
|
+
md: (
|
|
466
|
+
font-size: scale.type-scale(14),
|
|
467
|
+
line-height: 1.15,
|
|
468
|
+
),
|
|
469
|
+
lg: (
|
|
470
|
+
font-size: scale.type-scale(17),
|
|
471
|
+
line-height: 1.11,
|
|
472
|
+
letter-spacing: -0.64px,
|
|
473
|
+
),
|
|
474
|
+
xlg: (
|
|
475
|
+
font-size: scale.type-scale(20),
|
|
476
|
+
line-height: 1.07,
|
|
477
|
+
letter-spacing: -0.64px,
|
|
478
|
+
),
|
|
479
|
+
max: (
|
|
480
|
+
font-size: scale.type-scale(23),
|
|
481
|
+
line-height: 1.05,
|
|
482
|
+
letter-spacing: -0.96px,
|
|
483
|
+
),
|
|
484
|
+
),
|
|
485
|
+
) !default;
|
|
486
|
+
|
|
487
|
+
/// @type Map
|
|
488
|
+
/// @access public
|
|
489
|
+
/// @group @carbon/type
|
|
490
|
+
$tokens: (
|
|
491
|
+
caption-01: $caption-01,
|
|
492
|
+
label-01: $label-01,
|
|
493
|
+
helper-text-01: $helper-text-01,
|
|
494
|
+
body-short-01: $body-short-01,
|
|
495
|
+
body-short-02: $body-short-02,
|
|
496
|
+
body-long-01: $body-long-01,
|
|
497
|
+
body-long-02: $body-long-02,
|
|
498
|
+
code-01: $code-01,
|
|
499
|
+
code-02: $code-02,
|
|
500
|
+
heading-01: $heading-01,
|
|
501
|
+
heading-02: $heading-02,
|
|
502
|
+
productive-heading-01: $productive-heading-01,
|
|
503
|
+
productive-heading-02: $productive-heading-02,
|
|
504
|
+
productive-heading-03: $productive-heading-03,
|
|
505
|
+
productive-heading-04: $productive-heading-04,
|
|
506
|
+
productive-heading-05: $productive-heading-05,
|
|
507
|
+
productive-heading-06: $productive-heading-06,
|
|
508
|
+
productive-heading-07: $productive-heading-07,
|
|
509
|
+
expressive-paragraph-01: $expressive-paragraph-01,
|
|
510
|
+
expressive-heading-01: $expressive-heading-01,
|
|
511
|
+
expressive-heading-02: $expressive-heading-02,
|
|
512
|
+
expressive-heading-03: $expressive-heading-03,
|
|
513
|
+
expressive-heading-04: $expressive-heading-04,
|
|
514
|
+
expressive-heading-05: $expressive-heading-05,
|
|
515
|
+
expressive-heading-06: $expressive-heading-06,
|
|
516
|
+
quotation-01: $quotation-01,
|
|
517
|
+
quotation-02: $quotation-02,
|
|
518
|
+
display-01: $display-01,
|
|
519
|
+
display-02: $display-02,
|
|
520
|
+
display-03: $display-03,
|
|
521
|
+
display-04: $display-04,
|
|
522
|
+
);
|
|
523
|
+
|
|
524
|
+
/// @param {Map} $map
|
|
525
|
+
/// @access public
|
|
526
|
+
/// @group @carbon/type
|
|
527
|
+
@mixin properties($map) {
|
|
528
|
+
@each $name, $value in $map {
|
|
529
|
+
#{$name}: $value;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/// @param {Number} $value - Number with units
|
|
534
|
+
/// @return {Number} Without units
|
|
535
|
+
/// @access public
|
|
536
|
+
/// @group @carbon/type
|
|
537
|
+
@function strip-unit($value) {
|
|
538
|
+
@return $value / ($value * 0 + 1);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/// This helper includes fluid type styles for the given token value. Fluid type
|
|
542
|
+
/// means that the `font-size` is computed using `calc()` in order to be
|
|
543
|
+
/// determined by the screen size instead of a breakpoint. As a result, fluid
|
|
544
|
+
/// styles should be used with caution in fixed width contexts.
|
|
545
|
+
///
|
|
546
|
+
/// In addition, we make use of %-based line-heights so that the line-height of
|
|
547
|
+
/// each type style is computed correctly due to the dynamic nature of the
|
|
548
|
+
/// `font-size`.
|
|
549
|
+
///
|
|
550
|
+
/// Most of the logic for this work comes from CSS Tricks:
|
|
551
|
+
/// https://css-tricks.com/snippets/css/fluid-typography/
|
|
552
|
+
///
|
|
553
|
+
/// @param {Map} $type-styles - The value of a given type token
|
|
554
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - Custom breakpoints to use
|
|
555
|
+
/// @access public
|
|
556
|
+
/// @group @carbon/type
|
|
557
|
+
@mixin fluid-type($type-styles, $breakpoints: layout.$grid-breakpoints) {
|
|
558
|
+
// Include the initial styles for the given token by default without any
|
|
559
|
+
// media query guard. This includes `font-size` as a fallback in the case
|
|
560
|
+
// that a browser does not support `calc()`
|
|
561
|
+
@include properties(map.remove($type-styles, breakpoints));
|
|
562
|
+
// We also need to include the `sm` styles by default since they don't
|
|
563
|
+
// appear in the fluid styles for tokens
|
|
564
|
+
@include fluid-type-size($type-styles, sm, $breakpoints);
|
|
565
|
+
|
|
566
|
+
// Finally, we need to go through all the breakpoints defined in the type
|
|
567
|
+
// token and apply the properties and fluid type size for that given
|
|
568
|
+
// breakpoint
|
|
569
|
+
@each $name, $values in map.get($type-styles, breakpoints) {
|
|
570
|
+
@include layout.breakpoint($name) {
|
|
571
|
+
@include properties($values);
|
|
572
|
+
@include fluid-type-size($type-styles, $name, $breakpoints);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/// Computes the fluid `font-size` for a given type style and breakpoint
|
|
578
|
+
/// @param {Map} $type-styles - The styles for a given token
|
|
579
|
+
/// @param {String} $name - The name of the breakpoint to which we apply the fluid
|
|
580
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints for the grid system
|
|
581
|
+
/// @access public
|
|
582
|
+
/// @group @carbon/type
|
|
583
|
+
@mixin fluid-type-size(
|
|
584
|
+
$type-styles,
|
|
585
|
+
$name,
|
|
586
|
+
$breakpoints: layout.$grid-breakpoints
|
|
587
|
+
) {
|
|
588
|
+
// Get the information about the breakpoint we're currently working in. Useful
|
|
589
|
+
// for getting initial width information
|
|
590
|
+
$breakpoint: map.get($breakpoints, $name);
|
|
591
|
+
|
|
592
|
+
// Our fluid styles are captured under the 'breakpoints' property in our type
|
|
593
|
+
// styles map. These define what values to treat as `max-` variables below
|
|
594
|
+
$fluid-sizes: map.get($type-styles, breakpoints);
|
|
595
|
+
$fluid-breakpoint: ();
|
|
596
|
+
// Special case for `sm` because the styles for small are on the type style
|
|
597
|
+
// directly
|
|
598
|
+
@if $name == sm {
|
|
599
|
+
$fluid-breakpoint: map.remove($type-styles, breakpoints);
|
|
600
|
+
} @else {
|
|
601
|
+
$fluid-breakpoint: map.get($fluid-sizes, $name);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
// Initialize our font-sizes to the default size for the type style
|
|
605
|
+
$max-font-size: map.get($type-styles, font-size);
|
|
606
|
+
$min-font-size: map.get($type-styles, font-size);
|
|
607
|
+
@if map.has-key($fluid-breakpoint, font-size) {
|
|
608
|
+
$min-font-size: map.get($fluid-breakpoint, font-size);
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
// Initialize our min and max width to the width of the current breakpoint
|
|
612
|
+
$max-vw: map.get($breakpoint, width);
|
|
613
|
+
$min-vw: map.get($breakpoint, width);
|
|
614
|
+
|
|
615
|
+
// We can use `breakpoint-next` to see if there is another breakpoint we can
|
|
616
|
+
// use to update `max-font-size` and `max-vw` with larger values
|
|
617
|
+
$next-breakpoint-available: layout.breakpoint-next($name, $breakpoints);
|
|
618
|
+
$next-fluid-breakpoint-name: null;
|
|
619
|
+
|
|
620
|
+
// We need to figure out what the next available fluid breakpoint is for our
|
|
621
|
+
// given $type-styles. In this loop we try and iterate through breakpoints
|
|
622
|
+
// until we either manually set $next-breakpoint-available to null or
|
|
623
|
+
// `breakpoint-next` returns null.
|
|
624
|
+
@while $next-breakpoint-available {
|
|
625
|
+
@if map.has-key($fluid-sizes, $next-breakpoint-available) {
|
|
626
|
+
$next-fluid-breakpoint-name: $next-breakpoint-available;
|
|
627
|
+
$next-breakpoint-available: null;
|
|
628
|
+
} @else {
|
|
629
|
+
$next-breakpoint-available: layout.breakpoint-next(
|
|
630
|
+
$next-breakpoint-available,
|
|
631
|
+
$breakpoints
|
|
632
|
+
);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
// If we have found the next available fluid breakpoint name, then we know
|
|
637
|
+
// that we have values that we can use to set max-font-size and max-vw as both
|
|
638
|
+
// values derive from the next breakpoint
|
|
639
|
+
@if $next-fluid-breakpoint-name {
|
|
640
|
+
$next-fluid-breakpoint: map.get($breakpoints, $next-fluid-breakpoint-name);
|
|
641
|
+
$max-font-size: map.get(
|
|
642
|
+
map.get($fluid-sizes, $next-fluid-breakpoint-name),
|
|
643
|
+
font-size
|
|
644
|
+
);
|
|
645
|
+
$max-vw: map.get($next-fluid-breakpoint, width);
|
|
646
|
+
|
|
647
|
+
// prettier-ignore
|
|
648
|
+
font-size: calc(#{$min-font-size} +
|
|
649
|
+
#{strip-unit($max-font-size - $min-font-size)} *
|
|
650
|
+
((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})
|
|
651
|
+
);
|
|
652
|
+
} @else {
|
|
653
|
+
// Otherwise, just default to setting the font size found from the type
|
|
654
|
+
// style or the given fluid breakpoint in the type style
|
|
655
|
+
font-size: $min-font-size;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
// TODO move following variable and `custom-property` mixin into shared file for
|
|
660
|
+
// both `@carbon/type` and `@carbon/themes`
|
|
661
|
+
|
|
662
|
+
/// @access private
|
|
663
|
+
/// @group @carbon/type
|
|
664
|
+
$custom-property-prefix: 'cds' !default;
|
|
665
|
+
|
|
666
|
+
/// @access private
|
|
667
|
+
/// @group @carbon/type
|
|
668
|
+
@mixin custom-properties($name, $value) {
|
|
669
|
+
@each $property, $value in $value {
|
|
670
|
+
#{$property}: var(
|
|
671
|
+
--#{$custom-property-prefix}-#{$name}-#{$property},
|
|
672
|
+
#{$value}
|
|
673
|
+
);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/// Helper mixin to include the styles for a given token in any selector in your
|
|
678
|
+
/// project. Also includes an optional fluid option that will enable fluid
|
|
679
|
+
/// styles for the token if they are defined. Fluid styles will cause the
|
|
680
|
+
/// token's font-size to be computed based on the viewport size. As a result, use
|
|
681
|
+
/// with caution in fixed contexts.
|
|
682
|
+
/// @param {String} $name - The name of the token to get the styles for
|
|
683
|
+
/// @param {Boolean} $fluid [false] - Specify whether to include fluid styles for the
|
|
684
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - Provide a custom breakpoint map to use
|
|
685
|
+
/// @access public
|
|
686
|
+
/// @group @carbon/type
|
|
687
|
+
@mixin type-style(
|
|
688
|
+
$name,
|
|
689
|
+
$fluid: false,
|
|
690
|
+
$breakpoints: layout.$grid-breakpoints
|
|
691
|
+
) {
|
|
692
|
+
@if not map.has-key($tokens, $name) {
|
|
693
|
+
@error 'Unable to find a token with the name: `#{$name}`';
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
$token: map.get($tokens, $name);
|
|
697
|
+
|
|
698
|
+
// If $fluid is set to true and the token has breakpoints defined for fluid
|
|
699
|
+
// styles, delegate to the fluid-type helper for the given token
|
|
700
|
+
@if $fluid == true and map.has-key($token, 'breakpoints') {
|
|
701
|
+
@include fluid-type($token, $breakpoints);
|
|
702
|
+
} @else {
|
|
703
|
+
@if global-variable-exists('feature-flags') and
|
|
704
|
+
map.get($feature-flags, 'enable-css-custom-properties')
|
|
705
|
+
{
|
|
706
|
+
@include custom-properties($name, $token);
|
|
707
|
+
} @else {
|
|
708
|
+
// Otherwise, we just include all the property declarations directly on the
|
|
709
|
+
// selector
|
|
710
|
+
@include properties(map.remove($token, 'breakpoints'));
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}
|