@carbon/elements 10.26.0-rc.3 → 10.27.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.
- package/README.md +0 -6
- package/es/index.js +1 -1
- package/lib/index.js +30 -0
- package/package.json +12 -12
- package/scss/grid/vendor/@carbon/layout/modules/_breakpoint.scss +232 -0
- package/scss/grid/vendor/@carbon/layout/modules/_convert.scss +40 -0
- package/scss/grid/vendor/@carbon/layout/modules/_spacing.scss +9 -0
- package/scss/grid/vendor/@carbon/layout/modules/_utilities.scss +41 -0
- package/scss/grid/vendor/@carbon/layout/modules/generated/_fluid-spacing.scss +37 -0
- package/scss/grid/vendor/@carbon/layout/modules/generated/_spacing.scss +85 -0
- package/scss/layout/modules/_breakpoint.scss +232 -0
- package/scss/layout/modules/_convert.scss +40 -0
- package/scss/layout/modules/_spacing.scss +9 -0
- package/scss/layout/modules/_utilities.scss +41 -0
- package/scss/layout/modules/generated/_fluid-spacing.scss +37 -0
- package/scss/layout/modules/generated/_spacing.scss +85 -0
- package/scss/themes/modules/_theme.scss +50 -0
- package/scss/themes/modules/_themes.scss +8 -0
- package/scss/themes/modules/_utilities.scss +18 -0
- package/scss/themes/modules/generated/_themes.scss +244 -0
- package/scss/type/modules/_classes.scss +42 -0
- package/scss/type/modules/_font-family.scss +70 -0
- package/scss/type/modules/_prefix.scss +11 -0
- package/scss/type/modules/_reset.scss +92 -0
- package/scss/type/modules/_scale.scss +56 -0
- package/scss/type/modules/_styles.scss +713 -0
- package/scss/type/vendor/@carbon/layout/modules/_breakpoint.scss +232 -0
- package/scss/type/vendor/@carbon/layout/modules/_convert.scss +40 -0
- package/scss/type/vendor/@carbon/layout/modules/_spacing.scss +9 -0
- package/scss/type/vendor/@carbon/layout/modules/_utilities.scss +41 -0
- package/scss/type/vendor/@carbon/layout/modules/generated/_fluid-spacing.scss +37 -0
- package/scss/type/vendor/@carbon/layout/modules/generated/_spacing.scss +85 -0
- package/src/__tests__/__snapshots__/PublicAPI-test.js.snap +5 -0
- package/src/index.js +5 -0
- package/umd/index.js +30 -0
- package/scss/colors/module.scss +0 -705
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
// Code generated by @carbon/themes. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2019
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@use 'sass:map';
|
|
10
|
+
@use '@carbon/layout';
|
|
11
|
+
@use '@carbon/type';
|
|
12
|
+
@use '../utilities';
|
|
13
|
+
|
|
14
|
+
$white: utilities.merge(
|
|
15
|
+
layout.$spacing,
|
|
16
|
+
layout.$fluid-spacing,
|
|
17
|
+
type.$tokens,
|
|
18
|
+
(
|
|
19
|
+
interactive-01: #0f62fe,
|
|
20
|
+
interactive-02: #393939,
|
|
21
|
+
interactive-03: #0f62fe,
|
|
22
|
+
interactive-04: #0f62fe,
|
|
23
|
+
ui-background: #ffffff,
|
|
24
|
+
ui-01: #f4f4f4,
|
|
25
|
+
ui-02: #ffffff,
|
|
26
|
+
ui-03: #e0e0e0,
|
|
27
|
+
ui-04: #8d8d8d,
|
|
28
|
+
ui-05: #161616,
|
|
29
|
+
text-01: #161616,
|
|
30
|
+
text-02: #525252,
|
|
31
|
+
text-03: #a8a8a8,
|
|
32
|
+
text-04: #ffffff,
|
|
33
|
+
text-05: #6f6f6f,
|
|
34
|
+
text-error: #da1e28,
|
|
35
|
+
icon-01: #161616,
|
|
36
|
+
icon-02: #525252,
|
|
37
|
+
icon-03: #ffffff,
|
|
38
|
+
link-01: #0f62fe,
|
|
39
|
+
inverse-link: #78a9ff,
|
|
40
|
+
field-01: #f4f4f4,
|
|
41
|
+
field-02: #ffffff,
|
|
42
|
+
inverse-01: #ffffff,
|
|
43
|
+
inverse-02: #393939,
|
|
44
|
+
support-01: #da1e28,
|
|
45
|
+
support-02: #24a148,
|
|
46
|
+
support-03: #f1c21b,
|
|
47
|
+
support-04: #0043ce,
|
|
48
|
+
inverse-support-01: #fa4d56,
|
|
49
|
+
inverse-support-02: #42be65,
|
|
50
|
+
inverse-support-03: #f1c21b,
|
|
51
|
+
inverse-support-04: #4589ff,
|
|
52
|
+
overlay-01: rgba(22, 22, 22, 0.5),
|
|
53
|
+
danger-01: #da1e28,
|
|
54
|
+
danger-02: #da1e28,
|
|
55
|
+
focus: #0f62fe,
|
|
56
|
+
inverse-focus-ui: #ffffff,
|
|
57
|
+
hover-primary: #0353e9,
|
|
58
|
+
active-primary: #002d9c,
|
|
59
|
+
hover-primary-text: #0043ce,
|
|
60
|
+
hover-secondary: #4c4c4c,
|
|
61
|
+
active-secondary: #6f6f6f,
|
|
62
|
+
hover-tertiary: #0353e9,
|
|
63
|
+
active-tertiary: #002d9c,
|
|
64
|
+
hover-ui: #e5e5e5,
|
|
65
|
+
hover-light-ui: #e5e5e5,
|
|
66
|
+
active-ui: #c6c6c6,
|
|
67
|
+
active-light-ui: #c6c6c6,
|
|
68
|
+
selected-ui: #e0e0e0,
|
|
69
|
+
selected-light-ui: #e0e0e0,
|
|
70
|
+
inverse-hover-ui: #4c4c4c,
|
|
71
|
+
hover-selected-ui: #cacaca,
|
|
72
|
+
hover-danger: #b81921,
|
|
73
|
+
active-danger: #750e13,
|
|
74
|
+
hover-row: #e5e5e5,
|
|
75
|
+
visited-link: #8a3ffc,
|
|
76
|
+
disabled-01: #f4f4f4,
|
|
77
|
+
disabled-02: #c6c6c6,
|
|
78
|
+
disabled-03: #8d8d8d,
|
|
79
|
+
highlight: #d0e2ff,
|
|
80
|
+
decorative-01: #e0e0e0,
|
|
81
|
+
button-separator: #e0e0e0,
|
|
82
|
+
skeleton-01: #e5e5e5,
|
|
83
|
+
skeleton-02: #c6c6c6,
|
|
84
|
+
brand-01: #0f62fe,
|
|
85
|
+
brand-02: #393939,
|
|
86
|
+
brand-03: #0f62fe,
|
|
87
|
+
active-01: #c6c6c6,
|
|
88
|
+
hover-field: #e5e5e5,
|
|
89
|
+
danger: #da1e28,
|
|
90
|
+
)
|
|
91
|
+
) !default;
|
|
92
|
+
|
|
93
|
+
/// Carbon's g10 color theme
|
|
94
|
+
/// @type Map
|
|
95
|
+
/// @access public
|
|
96
|
+
/// @group @carbon/themes
|
|
97
|
+
$g10: map.merge(
|
|
98
|
+
$white,
|
|
99
|
+
(
|
|
100
|
+
ui-background: #f4f4f4,
|
|
101
|
+
ui-01: #ffffff,
|
|
102
|
+
ui-02: #f4f4f4,
|
|
103
|
+
field-01: #ffffff,
|
|
104
|
+
field-02: #f4f4f4,
|
|
105
|
+
disabled-01: #ffffff,
|
|
106
|
+
highlight: #edf5ff,
|
|
107
|
+
)
|
|
108
|
+
) !default;
|
|
109
|
+
|
|
110
|
+
/// Carbon's g90 color theme
|
|
111
|
+
/// @type Map
|
|
112
|
+
/// @access public
|
|
113
|
+
/// @group @carbon/themes
|
|
114
|
+
$g90: map.merge(
|
|
115
|
+
$white,
|
|
116
|
+
(
|
|
117
|
+
interactive-02: #6f6f6f,
|
|
118
|
+
interactive-03: #ffffff,
|
|
119
|
+
interactive-04: #4589ff,
|
|
120
|
+
ui-background: #262626,
|
|
121
|
+
ui-01: #393939,
|
|
122
|
+
ui-02: #525252,
|
|
123
|
+
ui-03: #525252,
|
|
124
|
+
ui-05: #f4f4f4,
|
|
125
|
+
text-01: #f4f4f4,
|
|
126
|
+
text-02: #c6c6c6,
|
|
127
|
+
text-03: #6f6f6f,
|
|
128
|
+
text-05: #8d8d8d,
|
|
129
|
+
text-error: #ffb3b8,
|
|
130
|
+
icon-01: #f4f4f4,
|
|
131
|
+
icon-02: #c6c6c6,
|
|
132
|
+
link-01: #78a9ff,
|
|
133
|
+
inverse-link: #0f62fe,
|
|
134
|
+
field-01: #393939,
|
|
135
|
+
field-02: #525252,
|
|
136
|
+
inverse-01: #161616,
|
|
137
|
+
inverse-02: #f4f4f4,
|
|
138
|
+
support-01: #ff8389,
|
|
139
|
+
support-02: #42be65,
|
|
140
|
+
support-04: #4589ff,
|
|
141
|
+
inverse-support-01: #da1e28,
|
|
142
|
+
inverse-support-02: #24a148,
|
|
143
|
+
inverse-support-04: #0f62fe,
|
|
144
|
+
overlay-01: rgba(22, 22, 22, 0.7),
|
|
145
|
+
danger-02: #ff8389,
|
|
146
|
+
focus: #ffffff,
|
|
147
|
+
inverse-focus-ui: #0f62fe,
|
|
148
|
+
hover-primary-text: #a6c8ff,
|
|
149
|
+
hover-secondary: #606060,
|
|
150
|
+
active-secondary: #393939,
|
|
151
|
+
hover-tertiary: #f4f4f4,
|
|
152
|
+
active-tertiary: #c6c6c6,
|
|
153
|
+
hover-ui: #4c4c4c,
|
|
154
|
+
hover-light-ui: #656565,
|
|
155
|
+
active-ui: #6f6f6f,
|
|
156
|
+
active-light-ui: #8d8d8d,
|
|
157
|
+
selected-ui: #525252,
|
|
158
|
+
selected-light-ui: #6f6f6f,
|
|
159
|
+
inverse-hover-ui: #e5e5e5,
|
|
160
|
+
hover-selected-ui: #656565,
|
|
161
|
+
hover-row: #4c4c4c,
|
|
162
|
+
visited-link: #be95ff,
|
|
163
|
+
disabled-01: #393939,
|
|
164
|
+
disabled-02: #6f6f6f,
|
|
165
|
+
disabled-03: #a8a8a8,
|
|
166
|
+
highlight: #0043ce,
|
|
167
|
+
decorative-01: #6f6f6f,
|
|
168
|
+
button-separator: #161616,
|
|
169
|
+
skeleton-01: #353535,
|
|
170
|
+
skeleton-02: #525252,
|
|
171
|
+
brand-02: #6f6f6f,
|
|
172
|
+
brand-03: #ffffff,
|
|
173
|
+
active-01: #6f6f6f,
|
|
174
|
+
hover-field: #4c4c4c,
|
|
175
|
+
)
|
|
176
|
+
) !default;
|
|
177
|
+
|
|
178
|
+
/// Carbon's g100 color theme
|
|
179
|
+
/// @type Map
|
|
180
|
+
/// @access public
|
|
181
|
+
/// @group @carbon/themes
|
|
182
|
+
$g100: map.merge(
|
|
183
|
+
$white,
|
|
184
|
+
(
|
|
185
|
+
interactive-02: #6f6f6f,
|
|
186
|
+
interactive-03: #ffffff,
|
|
187
|
+
interactive-04: #4589ff,
|
|
188
|
+
ui-background: #161616,
|
|
189
|
+
ui-01: #262626,
|
|
190
|
+
ui-02: #393939,
|
|
191
|
+
ui-03: #393939,
|
|
192
|
+
ui-04: #6f6f6f,
|
|
193
|
+
ui-05: #f4f4f4,
|
|
194
|
+
text-01: #f4f4f4,
|
|
195
|
+
text-02: #c6c6c6,
|
|
196
|
+
text-03: #6f6f6f,
|
|
197
|
+
text-05: #8d8d8d,
|
|
198
|
+
text-error: #ff8389,
|
|
199
|
+
icon-01: #f4f4f4,
|
|
200
|
+
icon-02: #c6c6c6,
|
|
201
|
+
link-01: #78a9ff,
|
|
202
|
+
inverse-link: #0f62fe,
|
|
203
|
+
field-01: #262626,
|
|
204
|
+
field-02: #393939,
|
|
205
|
+
inverse-01: #161616,
|
|
206
|
+
inverse-02: #f4f4f4,
|
|
207
|
+
support-01: #fa4d56,
|
|
208
|
+
support-02: #42be65,
|
|
209
|
+
support-04: #4589ff,
|
|
210
|
+
inverse-support-01: #da1e28,
|
|
211
|
+
inverse-support-02: #24a148,
|
|
212
|
+
inverse-support-04: #0f62fe,
|
|
213
|
+
overlay-01: rgba(22, 22, 22, 0.7),
|
|
214
|
+
danger-02: #fa4d56,
|
|
215
|
+
focus: #ffffff,
|
|
216
|
+
inverse-focus-ui: #0f62fe,
|
|
217
|
+
hover-primary-text: #a6c8ff,
|
|
218
|
+
hover-secondary: #606060,
|
|
219
|
+
active-secondary: #393939,
|
|
220
|
+
hover-tertiary: #f4f4f4,
|
|
221
|
+
active-tertiary: #c6c6c6,
|
|
222
|
+
hover-ui: #353535,
|
|
223
|
+
hover-light-ui: #4c4c4c,
|
|
224
|
+
active-ui: #525252,
|
|
225
|
+
active-light-ui: #6f6f6f,
|
|
226
|
+
selected-ui: #393939,
|
|
227
|
+
selected-light-ui: #525252,
|
|
228
|
+
inverse-hover-ui: #e5e5e5,
|
|
229
|
+
hover-selected-ui: #4c4c4c,
|
|
230
|
+
hover-row: #353535,
|
|
231
|
+
visited-link: #be95ff,
|
|
232
|
+
disabled-01: #262626,
|
|
233
|
+
disabled-02: #525252,
|
|
234
|
+
highlight: #002d9c,
|
|
235
|
+
decorative-01: #525252,
|
|
236
|
+
button-separator: #161616,
|
|
237
|
+
skeleton-01: #353535,
|
|
238
|
+
skeleton-02: #393939,
|
|
239
|
+
brand-02: #6f6f6f,
|
|
240
|
+
brand-03: #ffffff,
|
|
241
|
+
active-01: #525252,
|
|
242
|
+
hover-field: #353535,
|
|
243
|
+
)
|
|
244
|
+
) !default;
|
|
@@ -0,0 +1,42 @@
|
|
|
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 'font-family' as *;
|
|
10
|
+
@use 'prefix' as *;
|
|
11
|
+
@use 'styles' as *;
|
|
12
|
+
|
|
13
|
+
/// Create type classes for font families, weights, styles
|
|
14
|
+
/// @access public
|
|
15
|
+
/// @group @carbon/type
|
|
16
|
+
@mixin type-classes {
|
|
17
|
+
// Font families
|
|
18
|
+
@each $name, $value in $font-families {
|
|
19
|
+
.#{$prefix}--type-#{$name} {
|
|
20
|
+
font-family: $value;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Font weights
|
|
25
|
+
@each $name, $value in $font-weights {
|
|
26
|
+
.#{$prefix}--type-#{$name} {
|
|
27
|
+
font-weight: $value;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Font styles
|
|
32
|
+
.#{$prefix}--type-italic {
|
|
33
|
+
font-style: italic;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Type styles
|
|
37
|
+
@each $name, $value in $tokens {
|
|
38
|
+
.#{$prefix}--type-#{$name} {
|
|
39
|
+
@include type-style($name, map.has-key($value, breakpoints));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
/// Font family fallbacks for: IBM Plex Mono, IBM Plex Sans, IBM Plex Sans
|
|
9
|
+
/// Condensed, IBM Plex Sans Hebrew, and IBM Plex Serif
|
|
10
|
+
/// @type Map
|
|
11
|
+
/// @access public
|
|
12
|
+
/// @group @carbon/type
|
|
13
|
+
$font-families: (
|
|
14
|
+
'mono':
|
|
15
|
+
unquote(
|
|
16
|
+
"'IBM Plex Mono', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace"
|
|
17
|
+
),
|
|
18
|
+
'sans': unquote("'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif"),
|
|
19
|
+
'sans-condensed':
|
|
20
|
+
unquote("'IBM Plex Sans Condensed', 'Helvetica Neue', Arial, sans-serif"),
|
|
21
|
+
'sans-hebrew':
|
|
22
|
+
unquote(
|
|
23
|
+
"'IBM Plex Sans Hebrew', 'Helvetica Hebrew', 'Arial Hebrew', sans-serif"
|
|
24
|
+
),
|
|
25
|
+
'serif': unquote("'IBM Plex Serif', 'Georgia', Times, serif"),
|
|
26
|
+
) !default;
|
|
27
|
+
|
|
28
|
+
/// Get the font-family for an IBM Plex font
|
|
29
|
+
/// @param {String} $name
|
|
30
|
+
/// @return {String}
|
|
31
|
+
/// @access public
|
|
32
|
+
/// @group @carbon/type
|
|
33
|
+
@function font-family($name) {
|
|
34
|
+
@return map-get($font-families, $name);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/// Include the `font-family` definition for the given name in your selector
|
|
38
|
+
/// @param {String} $name
|
|
39
|
+
/// @access public
|
|
40
|
+
/// @group @carbon/type
|
|
41
|
+
@mixin font-family($name) {
|
|
42
|
+
font-family: font-family($name);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/// Suggested font weights to be used in product
|
|
46
|
+
/// @type Map
|
|
47
|
+
/// @access public
|
|
48
|
+
/// @group @carbon/type
|
|
49
|
+
$font-weights: (
|
|
50
|
+
'light': 300,
|
|
51
|
+
'regular': 400,
|
|
52
|
+
'semibold': 600,
|
|
53
|
+
) !default;
|
|
54
|
+
|
|
55
|
+
/// Retrieve the font-weight value for a given name
|
|
56
|
+
/// @param {String} $weight
|
|
57
|
+
/// @return {Number}
|
|
58
|
+
/// @access public
|
|
59
|
+
/// @group @carbon/type
|
|
60
|
+
@function font-weight($weight) {
|
|
61
|
+
@return map-get($font-weights, $weight);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/// Set the `font-weight` property with the value for a given name
|
|
65
|
+
/// @param {String} $weight
|
|
66
|
+
/// @access public
|
|
67
|
+
/// @group @carbon/type
|
|
68
|
+
@mixin font-weight($weight) {
|
|
69
|
+
font-weight: font-weight($weight);
|
|
70
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
/// @type String
|
|
9
|
+
/// @access public
|
|
10
|
+
/// @group @carbon/type
|
|
11
|
+
$prefix: 'bx' !default;
|
|
@@ -0,0 +1,92 @@
|
|
|
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 'sass:meta';
|
|
10
|
+
@use '@carbon/layout';
|
|
11
|
+
@use 'font-family' as *;
|
|
12
|
+
@use 'styles' as *;
|
|
13
|
+
|
|
14
|
+
/// Include a type reset for a given body and mono font family
|
|
15
|
+
/// @param {String} $body-font-family [font-family('sans')] - The font family used on the `<body>` element
|
|
16
|
+
/// @param {String} $mono-font-family [font-family('mono')] - The font family used on elements that require mono fonts, like the `<code>` element
|
|
17
|
+
/// @access public
|
|
18
|
+
/// @group @carbon/type
|
|
19
|
+
@mixin type-reset(
|
|
20
|
+
// TODO: remove in next major release. This has been replaced with 100%
|
|
21
|
+
$base-font-size: layout.$base-font-size,
|
|
22
|
+
$body-font-family: font-family('sans'),
|
|
23
|
+
$mono-font-family: font-family('mono')
|
|
24
|
+
) {
|
|
25
|
+
html {
|
|
26
|
+
font-size: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
body {
|
|
30
|
+
@include font-weight('regular');
|
|
31
|
+
|
|
32
|
+
font-family: $body-font-family;
|
|
33
|
+
text-rendering: optimizeLegibility;
|
|
34
|
+
-webkit-font-smoothing: antialiased;
|
|
35
|
+
-moz-osx-font-smoothing: grayscale;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
code {
|
|
39
|
+
font-family: $mono-font-family;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
strong {
|
|
43
|
+
@include font-weight('semibold');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/// Include default type styles
|
|
48
|
+
/// @access public
|
|
49
|
+
/// @group @carbon/type
|
|
50
|
+
@mixin default-type {
|
|
51
|
+
h1 {
|
|
52
|
+
@include type-style('productive-heading-06');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
h2 {
|
|
56
|
+
@include type-style('productive-heading-05');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
h3 {
|
|
60
|
+
@include type-style('productive-heading-04');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
h4 {
|
|
64
|
+
@include type-style('productive-heading-03');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
h5 {
|
|
68
|
+
@include type-style('productive-heading-02');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
h6 {
|
|
72
|
+
@include type-style('productive-heading-01');
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
p {
|
|
76
|
+
@include type-style('body-long-02');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
a {
|
|
80
|
+
@if meta.global-variable-exists('carbon--theme') and
|
|
81
|
+
map.has-key($carbon--theme, 'link-01')
|
|
82
|
+
{
|
|
83
|
+
color: map.get($carbon--theme, 'link-01');
|
|
84
|
+
} @else {
|
|
85
|
+
color: #0062fe;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
em {
|
|
90
|
+
font-style: italic;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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 '@carbon/layout';
|
|
9
|
+
|
|
10
|
+
/// Compute the type size for the given type scale step
|
|
11
|
+
/// @param {Number} $step
|
|
12
|
+
/// @return {Number} In px
|
|
13
|
+
/// @access public
|
|
14
|
+
/// @group @carbon/type
|
|
15
|
+
@function get-type-size($step) {
|
|
16
|
+
@if $step == 1 {
|
|
17
|
+
@return 12px;
|
|
18
|
+
}
|
|
19
|
+
// Yn = Yn-1 + {INT[(n-2)/4] + 1} * 2
|
|
20
|
+
@return get-type-size($step - 1) + (floor(($step - 2) / 4) + 1) * 2;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/// Type scale follows a custom formula for determining each step size and supports sizes from 12px to 92px
|
|
24
|
+
/// @type Map
|
|
25
|
+
/// @access public
|
|
26
|
+
/// @group @carbon/type
|
|
27
|
+
$type-scale: ();
|
|
28
|
+
@for $i from 1 through 23 {
|
|
29
|
+
$type-scale: append($type-scale, layout.rem(get-type-size($i)));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/// Get the value of a specific step in the type scale
|
|
33
|
+
/// @param {Number} $step
|
|
34
|
+
/// @return {Number} In rem
|
|
35
|
+
/// @access public
|
|
36
|
+
/// @group @carbon/type
|
|
37
|
+
@function type-scale($step) {
|
|
38
|
+
@return nth($type-scale, $step);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/// Set the font-size value of a selector with the value at the given `$step`
|
|
42
|
+
/// @param {Number} $step
|
|
43
|
+
/// @access public
|
|
44
|
+
/// @group @carbon/type
|
|
45
|
+
@mixin type-scale($step) {
|
|
46
|
+
font-size: type-scale($step);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/// Alias of `type-scale` mixin.
|
|
50
|
+
/// @param {Number} $step
|
|
51
|
+
/// @alias type-scale
|
|
52
|
+
/// @access public
|
|
53
|
+
/// @group @carbon/type
|
|
54
|
+
@mixin font-size($step) {
|
|
55
|
+
font-size: type-scale($step);
|
|
56
|
+
}
|