@carbon/styles 1.41.0-rc.0 → 1.41.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/css/styles.css +310 -2
- package/css/styles.min.css +1 -1
- package/package.json +8 -8
- package/scss/__tests__/theme-test.js +9 -0
- package/scss/components/_index.scss +1 -0
- package/scss/components/slug/_index.scss +4 -0
- package/scss/components/slug/_slug.scss +346 -0
- package/scss/components/ui-shell/side-nav/_side-nav.scss +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/styles",
|
|
3
3
|
"description": "Styles for the Carbon Design System",
|
|
4
|
-
"version": "1.41.0
|
|
4
|
+
"version": "1.41.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@carbon/colors": "^11.20.0
|
|
41
|
+
"@carbon/colors": "^11.20.0",
|
|
42
42
|
"@carbon/feature-flags": "^0.16.0",
|
|
43
|
-
"@carbon/grid": "^11.21.0
|
|
44
|
-
"@carbon/layout": "^11.20.0
|
|
45
|
-
"@carbon/motion": "^11.16.0
|
|
46
|
-
"@carbon/themes": "^11.26.0
|
|
47
|
-
"@carbon/type": "^11.25.0
|
|
43
|
+
"@carbon/grid": "^11.21.0",
|
|
44
|
+
"@carbon/layout": "^11.20.0",
|
|
45
|
+
"@carbon/motion": "^11.16.0",
|
|
46
|
+
"@carbon/themes": "^11.26.0",
|
|
47
|
+
"@carbon/type": "^11.25.0",
|
|
48
48
|
"@ibm/plex": "6.0.0-next.6"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"scss/**/*.css",
|
|
66
66
|
"css/**/*.css"
|
|
67
67
|
],
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "abe693e46a9b76731f51e47104f3634b6346f845"
|
|
69
69
|
}
|
|
@@ -127,6 +127,15 @@ describe('@carbon/styles/scss/theme', () => {
|
|
|
127
127
|
"support-caution-major",
|
|
128
128
|
"support-caution-minor",
|
|
129
129
|
"support-caution-undefined",
|
|
130
|
+
"slug-background",
|
|
131
|
+
"slug-gradient",
|
|
132
|
+
"slug-background-hover",
|
|
133
|
+
"slug-gradient-hover",
|
|
134
|
+
"slug-hollow-hover",
|
|
135
|
+
"slug-callout-gradient-top",
|
|
136
|
+
"slug-callout-gradient-bottom",
|
|
137
|
+
"slug-callout-aura-start",
|
|
138
|
+
"slug-callout-aura-end",
|
|
130
139
|
"highlight",
|
|
131
140
|
"overlay",
|
|
132
141
|
"toggle-off",
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
@use '../../config' as *;
|
|
2
|
+
@use '../../colors' as *;
|
|
3
|
+
@use '../../motion' as *;
|
|
4
|
+
@use '../../theme' as *;
|
|
5
|
+
@use '../../type' as *;
|
|
6
|
+
@use '../../utilities/convert';
|
|
7
|
+
|
|
8
|
+
$sizes: (
|
|
9
|
+
mini: (
|
|
10
|
+
height: convert.to-rem(16px),
|
|
11
|
+
width: convert.to-rem(16px),
|
|
12
|
+
font-size: convert.to-rem(9px),
|
|
13
|
+
line-height: convert.to-rem(12px),
|
|
14
|
+
background: $slug-background,
|
|
15
|
+
),
|
|
16
|
+
2xs: (
|
|
17
|
+
height: convert.to-rem(20px),
|
|
18
|
+
width: convert.to-rem(20px),
|
|
19
|
+
font-size: convert.to-rem(12px),
|
|
20
|
+
line-height: convert.to-rem(16px),
|
|
21
|
+
background: $slug-background,
|
|
22
|
+
),
|
|
23
|
+
xs: (
|
|
24
|
+
height: convert.to-rem(24px),
|
|
25
|
+
width: convert.to-rem(24px),
|
|
26
|
+
font-size: convert.to-rem(12px),
|
|
27
|
+
line-height: convert.to-rem(16px),
|
|
28
|
+
background: $slug-gradient,
|
|
29
|
+
),
|
|
30
|
+
sm: (
|
|
31
|
+
height: convert.to-rem(32px),
|
|
32
|
+
width: convert.to-rem(32px),
|
|
33
|
+
font-size: convert.to-rem(16px),
|
|
34
|
+
line-height: convert.to-rem(21px),
|
|
35
|
+
background: $slug-gradient,
|
|
36
|
+
),
|
|
37
|
+
md: (
|
|
38
|
+
height: convert.to-rem(40px),
|
|
39
|
+
width: convert.to-rem(40px),
|
|
40
|
+
font-size: convert.to-rem(16px),
|
|
41
|
+
line-height: convert.to-rem(21px),
|
|
42
|
+
background: $slug-gradient,
|
|
43
|
+
),
|
|
44
|
+
lg: (
|
|
45
|
+
height: convert.to-rem(48px),
|
|
46
|
+
width: convert.to-rem(48px),
|
|
47
|
+
font-size: convert.to-rem(16px),
|
|
48
|
+
line-height: convert.to-rem(21px),
|
|
49
|
+
background: $slug-gradient,
|
|
50
|
+
),
|
|
51
|
+
xl: (
|
|
52
|
+
height: convert.to-rem(64px),
|
|
53
|
+
width: convert.to-rem(64px),
|
|
54
|
+
font-size: convert.to-rem(20px),
|
|
55
|
+
line-height: convert.to-rem(26px),
|
|
56
|
+
background: $slug-gradient,
|
|
57
|
+
),
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
/// Slug styles
|
|
61
|
+
/// @access public
|
|
62
|
+
/// @group slider
|
|
63
|
+
@mixin slug {
|
|
64
|
+
.#{$prefix}--slug {
|
|
65
|
+
display: flex;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.#{$prefix}--slug .#{$prefix}--slug__button {
|
|
69
|
+
position: relative;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
color: $text-inverse;
|
|
74
|
+
font-weight: 600;
|
|
75
|
+
transition: color $duration-fast-01 motion(entrance, productive),
|
|
76
|
+
border-color $duration-fast-01 motion(entrance, productive),
|
|
77
|
+
box-shadow $duration-fast-01 motion(entrance, productive);
|
|
78
|
+
|
|
79
|
+
@each $group, $size in $sizes {
|
|
80
|
+
// Create a class for each size slug
|
|
81
|
+
&--#{$group} {
|
|
82
|
+
@each $property, $value in $size {
|
|
83
|
+
// Set correct properties for each size
|
|
84
|
+
#{$property}: $value;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.#{$prefix}--slug .#{$prefix}--slug__button:focus {
|
|
91
|
+
box-shadow: inset 0 0 0 2px $focus, inset 0 0 0 3px $focus-inset;
|
|
92
|
+
outline: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.#{$prefix}--slug__text {
|
|
96
|
+
position: relative;
|
|
97
|
+
z-index: 1;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// pseudo element to animate the hover transition
|
|
101
|
+
.#{$prefix}--slug__button::before {
|
|
102
|
+
position: absolute;
|
|
103
|
+
background: $slug-gradient-hover;
|
|
104
|
+
block-size: 100%;
|
|
105
|
+
content: '';
|
|
106
|
+
inline-size: 100%;
|
|
107
|
+
opacity: 0;
|
|
108
|
+
transition: opacity $duration-fast-01 motion(entrance, productive);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.#{$prefix}--slug__button:hover::before {
|
|
112
|
+
opacity: 1;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Focus styles
|
|
116
|
+
.#{$prefix}--slug .#{$prefix}--slug__button:focus::before {
|
|
117
|
+
block-size: calc(100% - 6px);
|
|
118
|
+
inline-size: calc(100% - 6px);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.#{$prefix}--slug__button.#{$prefix}--slug__button--mini::before,
|
|
122
|
+
.#{$prefix}--slug__button.#{$prefix}--slug__button--2xs::before {
|
|
123
|
+
background: $slug-background-hover;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.#{$prefix}--slug__button.#{$prefix}--slug__button--mini:focus,
|
|
127
|
+
.#{$prefix}--slug__button.#{$prefix}--slug__button--2xs:focus {
|
|
128
|
+
box-shadow: inset 0 0 0 1px $focus, inset 0 0 0 2px $focus-inset;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.#{$prefix}--slug__button.#{$prefix}--slug__button--mini:focus::before,
|
|
132
|
+
.#{$prefix}--slug__button.#{$prefix}--slug__button--2xs:focus::before {
|
|
133
|
+
block-size: calc(100% - 4px);
|
|
134
|
+
inline-size: calc(100% - 4px);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Hollow slug
|
|
138
|
+
// Only allow mini, 2xs, and xs sizes
|
|
139
|
+
.#{$prefix}--slug__button--hollow.#{$prefix}--slug__button--sm,
|
|
140
|
+
.#{$prefix}--slug__button--hollow.#{$prefix}--slug__button--md,
|
|
141
|
+
.#{$prefix}--slug__button--hollow.#{$prefix}--slug__button--lg,
|
|
142
|
+
.#{$prefix}--slug__button--hollow.#{$prefix}--slug__button--xl {
|
|
143
|
+
block-size: convert.to-rem(24px);
|
|
144
|
+
font-size: convert.to-rem(12px);
|
|
145
|
+
inline-size: convert.to-rem(24px);
|
|
146
|
+
line-height: convert.to-rem(16px);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.#{$prefix}--slug__button--hollow::before {
|
|
150
|
+
display: none;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.#{$prefix}--slug .#{$prefix}--slug__button--hollow {
|
|
154
|
+
border: 1px solid $border-inverse;
|
|
155
|
+
background: transparent;
|
|
156
|
+
color: $text-primary;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.#{$prefix}--slug__button--hollow:hover {
|
|
160
|
+
border-color: $slug-hollow-hover;
|
|
161
|
+
color: $slug-hollow-hover;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.#{$prefix}--slug__button--hollow:focus {
|
|
165
|
+
border-color: $focus;
|
|
166
|
+
box-shadow: inset 0 0 0 1px $focus;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Inline slug
|
|
170
|
+
.#{$prefix}--slug .#{$prefix}--slug__button--inline {
|
|
171
|
+
border: 1px solid transparent;
|
|
172
|
+
border-radius: convert.to-rem(1px);
|
|
173
|
+
background: transparent;
|
|
174
|
+
block-size: initial;
|
|
175
|
+
color: $text-primary;
|
|
176
|
+
font-size: convert.to-rem(14px);
|
|
177
|
+
inline-size: initial;
|
|
178
|
+
line-height: initial;
|
|
179
|
+
padding-inline: convert.to-rem(4px);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.#{$prefix}--slug__button--inline::before {
|
|
183
|
+
display: none;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.#{$prefix}--slug .#{$prefix}--slug__button--inline:focus {
|
|
187
|
+
border-color: $focus;
|
|
188
|
+
box-shadow: none;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.#{$prefix}--slug .#{$prefix}--slug__button--inline:hover {
|
|
192
|
+
border-color: $icon-secondary;
|
|
193
|
+
color: $text-secondary;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.#{$prefix}--slug .#{$prefix}--slug__button--inline:focus:hover {
|
|
197
|
+
border-color: $focus;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.#{$prefix}--slug
|
|
201
|
+
.#{$prefix}--slug__button--inline:hover
|
|
202
|
+
.#{$prefix}--slug__text::before {
|
|
203
|
+
background: $icon-secondary;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.#{$prefix}--slug--hollow
|
|
207
|
+
.#{$prefix}--slug__button--inline:hover
|
|
208
|
+
.#{$prefix}--slug__text::before {
|
|
209
|
+
background: transparent;
|
|
210
|
+
box-shadow: inset 0 0 0 1px $icon-secondary;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.#{$prefix}--slug__button--inline .#{$prefix}--slug__text {
|
|
214
|
+
padding-inline-start: convert.to-rem(8px);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.#{$prefix}--slug__button--inline.#{$prefix}--slug__button--lg
|
|
218
|
+
.#{$prefix}--slug__text {
|
|
219
|
+
padding-inline-start: convert.to-rem(12px);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.#{$prefix}--slug__button--inline .#{$prefix}--slug__text::before {
|
|
223
|
+
position: absolute;
|
|
224
|
+
display: inline-block;
|
|
225
|
+
background: $icon-primary;
|
|
226
|
+
block-size: convert.to-rem(4px);
|
|
227
|
+
content: '';
|
|
228
|
+
inline-size: convert.to-rem(4px);
|
|
229
|
+
inset-block-start: 50%;
|
|
230
|
+
inset-inline-start: 0;
|
|
231
|
+
opacity: 1;
|
|
232
|
+
transform: translateY(-50%);
|
|
233
|
+
transition: background $duration-fast-01 motion(entrance, productive),
|
|
234
|
+
box-shadow $duration-fast-01 motion(entrance, productive);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Inline slug hollow dot
|
|
238
|
+
.#{$prefix}--slug--hollow .#{$prefix}--slug__text::before {
|
|
239
|
+
background: transparent;
|
|
240
|
+
block-size: convert.to-rem(6px);
|
|
241
|
+
box-shadow: inset 0 0 0 1px $icon-primary;
|
|
242
|
+
inline-size: convert.to-rem(6px);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.#{$prefix}--slug--hollow
|
|
246
|
+
.#{$prefix}--slug__button--sm
|
|
247
|
+
.#{$prefix}--slug__text,
|
|
248
|
+
.#{$prefix}--slug--hollow
|
|
249
|
+
.#{$prefix}--slug__button--md
|
|
250
|
+
.#{$prefix}--slug__text {
|
|
251
|
+
padding-inline-start: convert.to-rem(9px);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.#{$prefix}--slug__button--lg .#{$prefix}--slug__text::before,
|
|
255
|
+
.#{$prefix}--slug--hollow
|
|
256
|
+
.#{$prefix}--slug__button--lg
|
|
257
|
+
.#{$prefix}--slug__text::before {
|
|
258
|
+
block-size: convert.to-rem(8px);
|
|
259
|
+
inline-size: convert.to-rem(8px);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// Only allow sm, md, and lg sizes
|
|
263
|
+
.#{$prefix}--slug__button--inline.#{$prefix}--slug__button--mini,
|
|
264
|
+
.#{$prefix}--slug__button--inline.#{$prefix}--slug__button--mini
|
|
265
|
+
.#{$prefix}--slug__additional-text,
|
|
266
|
+
.#{$prefix}--slug__button--inline.#{$prefix}--slug__button--2xs,
|
|
267
|
+
.#{$prefix}--slug__button--inline.#{$prefix}--slug__button--2xs
|
|
268
|
+
.#{$prefix}--slug__additional-text,
|
|
269
|
+
.#{$prefix}--slug__button--inline.#{$prefix}--slug__button--xs,
|
|
270
|
+
.#{$prefix}--slug__button--inline.#{$prefix}--slug__button--xs
|
|
271
|
+
.#{$prefix}--slug__additional-text,
|
|
272
|
+
.#{$prefix}--slug__button--inline.#{$prefix}--slug__button--sm,
|
|
273
|
+
.#{$prefix}--slug__button--inline.#{$prefix}--slug__button--sm
|
|
274
|
+
.#{$prefix}--slug__additional-text {
|
|
275
|
+
font-size: convert.to-rem(12px);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.#{$prefix}--slug__button--inline.#{$prefix}--slug__button--lg,
|
|
279
|
+
.#{$prefix}--slug__button--inline.#{$prefix}--slug__button--xl {
|
|
280
|
+
font-size: convert.to-rem(16px);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// Inline slug with text
|
|
284
|
+
.#{$prefix}--slug .#{$prefix}--slug__button--inline-with-content {
|
|
285
|
+
border: 1px solid $border-inverse;
|
|
286
|
+
padding-block: convert.to-rem(2px);
|
|
287
|
+
padding-inline: convert.to-rem(8px);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.#{$prefix}--slug__button--inline-with-content
|
|
291
|
+
.#{$prefix}--slug__additional-text {
|
|
292
|
+
@include type-style('body-compact-02');
|
|
293
|
+
|
|
294
|
+
padding-inline-start: convert.to-rem(4px);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.#{$prefix}--slug__button--inline.#{$prefix}--slug__button--md
|
|
298
|
+
.#{$prefix}--slug__additional-text {
|
|
299
|
+
font-size: convert.to-rem(14px);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.#{$prefix}--slug .#{$prefix}--slug__button--inline-with-content:focus {
|
|
303
|
+
box-shadow: inset 0 0 0 1px $focus;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// Default callout styles
|
|
307
|
+
.#{$prefix}--slug.#{$prefix}--slug--hollow .#{$prefix}--toggletip-content {
|
|
308
|
+
row-gap: 0;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Slug callout styles
|
|
312
|
+
.#{$prefix}--slug.#{$prefix}--slug--enabled .#{$prefix}--popover-content {
|
|
313
|
+
border: 1px solid $border-subtle;
|
|
314
|
+
border-radius: 16px;
|
|
315
|
+
// 84px seems to make this fully opaque?
|
|
316
|
+
backdrop-filter: blur(25px);
|
|
317
|
+
background: linear-gradient(
|
|
318
|
+
0deg,
|
|
319
|
+
$slug-callout-aura-start 0%,
|
|
320
|
+
$slug-callout-aura-end 33%,
|
|
321
|
+
transparent 100%
|
|
322
|
+
),
|
|
323
|
+
linear-gradient(
|
|
324
|
+
180deg,
|
|
325
|
+
$slug-callout-gradient-top 0%,
|
|
326
|
+
$slug-callout-gradient-bottom 100%
|
|
327
|
+
)
|
|
328
|
+
rgba(0, 0, 0, 0.01);
|
|
329
|
+
// box-shadow seems to match the spec better
|
|
330
|
+
// than the same values plugged into `drop-shadow`
|
|
331
|
+
// filter: drop-shadow(-45px 45px 100px rgba(0, 0, 0, 0.2));
|
|
332
|
+
box-shadow: -45px 45px 100px rgba(0, 0, 0, 0.2);
|
|
333
|
+
color: $text-primary;
|
|
334
|
+
min-inline-size: convert.to-rem(280px);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.#{$prefix}--slug.#{$prefix}--slug--enabled .#{$prefix}--popover-caret {
|
|
338
|
+
background: $border-subtle;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.#{$prefix}--slug.#{$prefix}--slug--enabled .#{$prefix}--toggletip-content {
|
|
342
|
+
padding-block-end: convert.to-rem(80px);
|
|
343
|
+
padding-block-start: convert.to-rem(32px);
|
|
344
|
+
padding-inline: convert.to-rem(32px);
|
|
345
|
+
}
|
|
346
|
+
}
|