@carbon/styles 1.30.0 → 1.31.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 +403 -188
- package/css/styles.min.css +1 -1
- package/index.scss +1 -0
- package/package.json +10 -10
- package/scss/_layout.scss +85 -0
- package/scss/_reset.scss +9 -0
- package/scss/components/accordion/_accordion.scss +11 -20
- package/scss/components/button/_button.scss +25 -58
- package/scss/components/button/_mixins.scss +25 -4
- package/scss/components/code-snippet/_code-snippet.scss +11 -16
- package/scss/components/contained-list/_contained-list.scss +18 -34
- package/scss/components/content-switcher/_content-switcher.scss +12 -12
- package/scss/components/copy-button/_copy-button.scss +0 -2
- package/scss/components/data-table/_data-table.scss +72 -9
- package/scss/components/data-table/expandable/_data-table-expandable.scss +32 -2
- package/scss/components/data-table/sort/_data-table-sort.scss +33 -0
- package/scss/components/form/_form.scss +1 -0
- package/scss/components/menu/_menu.scss +4 -0
- package/scss/components/overflow-menu/_overflow-menu.scss +4 -0
- package/scss/components/pagination/_pagination.scss +5 -0
- package/scss/components/popover/_popover.scss +1 -0
- package/scss/components/progress-bar/_progress-bar.scss +10 -5
- package/scss/components/slider/_slider.scss +1 -1
- package/scss/components/tabs/_tabs.scss +7 -1
- package/scss/components/tag/_tag.scss +19 -12
- package/scss/components/text-input/_text-input.scss +6 -10
- package/scss/components/time-picker/_time-picker.scss +16 -0
- package/scss/components/ui-shell/header/_header.scss +4 -0
- package/scss/components/ui-shell/side-nav/_side-nav.scss +0 -3
- package/scss/utilities/_index.scss +1 -0
- package/scss/utilities/_layout.scss +134 -0
package/index.scss
CHANGED
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.
|
|
4
|
+
"version": "1.31.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
"sass": "^1.33.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@carbon/colors": "^11.
|
|
36
|
-
"@carbon/feature-flags": "^0.
|
|
37
|
-
"@carbon/grid": "^11.
|
|
38
|
-
"@carbon/layout": "^11.
|
|
39
|
-
"@carbon/motion": "^11.
|
|
40
|
-
"@carbon/themes": "^11.
|
|
41
|
-
"@carbon/type": "^11.
|
|
35
|
+
"@carbon/colors": "^11.16.0",
|
|
36
|
+
"@carbon/feature-flags": "^0.15.0",
|
|
37
|
+
"@carbon/grid": "^11.15.0",
|
|
38
|
+
"@carbon/layout": "^11.15.0",
|
|
39
|
+
"@carbon/motion": "^11.12.0",
|
|
40
|
+
"@carbon/themes": "^11.20.0",
|
|
41
|
+
"@carbon/type": "^11.19.0",
|
|
42
42
|
"@ibm/plex": "6.0.0-next.6"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@carbon/test-utils": "^10.
|
|
45
|
+
"@carbon/test-utils": "^10.30.0",
|
|
46
46
|
"autoprefixer": "^10.4.7",
|
|
47
47
|
"browserslist-config-carbon": "^11.2.0",
|
|
48
48
|
"css": "^3.0.0",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"scss/**/*.css",
|
|
60
60
|
"css/**/*.css"
|
|
61
61
|
],
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "4f3787a474ab93252975d717426c186ec4355812"
|
|
63
63
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright IBM Corp. 2023
|
|
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:list';
|
|
10
|
+
|
|
11
|
+
@use './config' as *;
|
|
12
|
+
@use './utilities/custom-property';
|
|
13
|
+
@use './utilities/convert' as *;
|
|
14
|
+
@use './utilities/layout' as *;
|
|
15
|
+
|
|
16
|
+
:root {
|
|
17
|
+
@each $group, $properties in $tokens {
|
|
18
|
+
@each $property, $steps in $properties {
|
|
19
|
+
@each $step, $value in $steps {
|
|
20
|
+
@include custom-property.declaration(
|
|
21
|
+
'layout-#{$group}-#{$property}-#{$step}',
|
|
22
|
+
$value
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// CSS max() doesn't accept '0' as a value without a unit
|
|
27
|
+
// stylelint-disable length-zero-no-unit
|
|
28
|
+
@include custom-property.declaration(
|
|
29
|
+
'layout-#{$group}-#{$property}-min',
|
|
30
|
+
0px
|
|
31
|
+
);
|
|
32
|
+
// stylelint-enable length-zero-no-unit
|
|
33
|
+
|
|
34
|
+
@include custom-property.declaration(
|
|
35
|
+
'layout-#{$group}-#{$property}-max',
|
|
36
|
+
999999999px
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@each $group, $properties in $tokens {
|
|
43
|
+
@each $property, $steps in $properties {
|
|
44
|
+
@each $step, $value in $steps {
|
|
45
|
+
.#{$prefix}--layout--#{$group}-#{$step} {
|
|
46
|
+
@include custom-property.declaration(
|
|
47
|
+
'layout-#{$group}-#{$property}-context',
|
|
48
|
+
custom-property.get-var(
|
|
49
|
+
'layout-#{$group}-#{$property}-#{$step}',
|
|
50
|
+
$value
|
|
51
|
+
)
|
|
52
|
+
);
|
|
53
|
+
@include custom-property.declaration(
|
|
54
|
+
'layout-#{$group}-#{$property}',
|
|
55
|
+
custom-property.get-var('layout-#{$group}-#{$property}-context')
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.#{$prefix}--layout-constraint--#{$group}\:default-#{$step} {
|
|
60
|
+
@include custom-property.declaration(
|
|
61
|
+
'layout-#{$group}-#{$property}',
|
|
62
|
+
custom-property.get-var(
|
|
63
|
+
'layout-#{$group}-#{$property}-context',
|
|
64
|
+
custom-property.get-var(
|
|
65
|
+
'layout-#{$group}-#{$property}-#{$step}',
|
|
66
|
+
$value
|
|
67
|
+
)
|
|
68
|
+
)
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@each $constraint in ('min', 'max') {
|
|
73
|
+
.#{$prefix}--layout-constraint--#{$group}\:#{$constraint}-#{$step} {
|
|
74
|
+
@include custom-property.declaration(
|
|
75
|
+
'layout-#{$group}-#{$property}-#{$constraint}',
|
|
76
|
+
custom-property.get-var(
|
|
77
|
+
'layout-#{$group}-#{$property}-#{$step}',
|
|
78
|
+
$value
|
|
79
|
+
)
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
package/scss/_reset.scss
CHANGED
|
@@ -103,6 +103,15 @@
|
|
|
103
103
|
vertical-align: baseline;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
// Chrome 62 fix
|
|
107
|
+
button,
|
|
108
|
+
select,
|
|
109
|
+
input,
|
|
110
|
+
textarea {
|
|
111
|
+
border-radius: 0;
|
|
112
|
+
font-family: inherit;
|
|
113
|
+
}
|
|
114
|
+
|
|
106
115
|
/* HTML5 display-role reset for older browsers */
|
|
107
116
|
article,
|
|
108
117
|
aside,
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
@use '../../utilities/button-reset';
|
|
15
15
|
@use '../../utilities/component-reset';
|
|
16
16
|
@use '../../utilities/convert';
|
|
17
|
+
@use '../../utilities/layout';
|
|
17
18
|
@use '../../utilities/focus-outline' as *;
|
|
18
19
|
@use '../../utilities/high-contrast-mode' as *;
|
|
19
20
|
|
|
@@ -30,12 +31,12 @@ $justify-content: flex-start !default;
|
|
|
30
31
|
/// @type Value
|
|
31
32
|
/// @access public
|
|
32
33
|
/// @group accordion
|
|
33
|
-
$arrow-margin:
|
|
34
|
+
$arrow-margin: 0 layout.density('padding-inline') 0 0 !default;
|
|
34
35
|
|
|
35
36
|
/// @type Value
|
|
36
37
|
/// @access public
|
|
37
38
|
/// @group accordion
|
|
38
|
-
$title-margin: 0 0 0
|
|
39
|
+
$title-margin: 0 0 0 layout.density('padding-inline') !default;
|
|
39
40
|
|
|
40
41
|
/// @type Value
|
|
41
42
|
/// @access public
|
|
@@ -44,6 +45,9 @@ $content-padding: 0 0 0 $spacing-05 !default;
|
|
|
44
45
|
|
|
45
46
|
@mixin accordion {
|
|
46
47
|
.#{$prefix}--accordion {
|
|
48
|
+
@include layout.use('size', $default: 'md', $min: 'sm', $max: 'lg');
|
|
49
|
+
@include layout.use('density', $default: 'normal');
|
|
50
|
+
|
|
47
51
|
@include component-reset.reset;
|
|
48
52
|
|
|
49
53
|
width: 100%;
|
|
@@ -67,11 +71,10 @@ $content-padding: 0 0 0 $spacing-05 !default;
|
|
|
67
71
|
position: relative;
|
|
68
72
|
display: flex;
|
|
69
73
|
width: 100%;
|
|
70
|
-
min-height:
|
|
74
|
+
min-height: layout.size('height');
|
|
71
75
|
flex-direction: $flex-direction;
|
|
72
|
-
align-items:
|
|
76
|
+
align-items: center;
|
|
73
77
|
justify-content: $justify-content;
|
|
74
|
-
padding: convert.rem(10px) 0;
|
|
75
78
|
margin: 0;
|
|
76
79
|
color: $text-primary;
|
|
77
80
|
cursor: pointer;
|
|
@@ -100,17 +103,6 @@ $content-padding: 0 0 0 $spacing-05 !default;
|
|
|
100
103
|
}
|
|
101
104
|
}
|
|
102
105
|
|
|
103
|
-
// Size styles
|
|
104
|
-
.#{$prefix}--accordion--lg .#{$prefix}--accordion__heading {
|
|
105
|
-
min-height: convert.rem(48px);
|
|
106
|
-
align-items: center;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.#{$prefix}--accordion--sm .#{$prefix}--accordion__heading {
|
|
110
|
-
min-height: convert.rem(32px);
|
|
111
|
-
padding: convert.rem(5px) 0;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
106
|
// Disabled styles
|
|
115
107
|
.#{$prefix}--accordion__heading[disabled] {
|
|
116
108
|
color: $text-disabled;
|
|
@@ -164,8 +156,7 @@ $content-padding: 0 0 0 $spacing-05 !default;
|
|
|
164
156
|
|
|
165
157
|
.#{$prefix}--accordion__content {
|
|
166
158
|
display: none;
|
|
167
|
-
padding-
|
|
168
|
-
padding-left: $spacing-05;
|
|
159
|
+
padding-inline: layout.density('padding-inline');
|
|
169
160
|
// Transition property for when the accordion closes
|
|
170
161
|
transition: padding motion(standard, productive) $duration-fast-02;
|
|
171
162
|
|
|
@@ -190,7 +181,7 @@ $content-padding: 0 0 0 $spacing-05 !default;
|
|
|
190
181
|
|
|
191
182
|
.#{$prefix}--accordion--start .#{$prefix}--accordion__arrow {
|
|
192
183
|
// Alters `$arrow-margin` token:
|
|
193
|
-
margin: 2px 0 0
|
|
184
|
+
margin: 2px 0 0 layout.density('padding-inline');
|
|
194
185
|
}
|
|
195
186
|
|
|
196
187
|
.#{$prefix}--accordion--start .#{$prefix}--accordion__title {
|
|
@@ -198,7 +189,7 @@ $content-padding: 0 0 0 $spacing-05 !default;
|
|
|
198
189
|
}
|
|
199
190
|
|
|
200
191
|
.#{$prefix}--accordion--start .#{$prefix}--accordion__content {
|
|
201
|
-
margin-left: $spacing-
|
|
192
|
+
margin-left: calc(#{layout.density('padding-inline')} + #{$spacing-05});
|
|
202
193
|
}
|
|
203
194
|
|
|
204
195
|
.#{$prefix}--accordion__item--collapsing .#{$prefix}--accordion__content,
|
|
@@ -16,10 +16,14 @@
|
|
|
16
16
|
@use '../../utilities/high-contrast-mode' as *;
|
|
17
17
|
@use '../../utilities/skeleton' as *;
|
|
18
18
|
@use '../../utilities/visually-hidden' as *;
|
|
19
|
+
@use '../../utilities/layout';
|
|
19
20
|
@use 'tokens' as *;
|
|
20
21
|
|
|
21
22
|
@mixin button {
|
|
22
23
|
.#{$prefix}--btn {
|
|
24
|
+
@include layout.use('size', $default: 'lg');
|
|
25
|
+
@include layout.use('density', $default: 'normal');
|
|
26
|
+
|
|
23
27
|
@include button-base;
|
|
24
28
|
}
|
|
25
29
|
|
|
@@ -107,7 +111,7 @@
|
|
|
107
111
|
$layer-active
|
|
108
112
|
);
|
|
109
113
|
|
|
110
|
-
padding:
|
|
114
|
+
padding-inline-end: calc(layout.density('padding-inline') - rem(1px));
|
|
111
115
|
|
|
112
116
|
.#{$prefix}--btn__icon {
|
|
113
117
|
position: static;
|
|
@@ -135,24 +139,25 @@
|
|
|
135
139
|
outline: none;
|
|
136
140
|
}
|
|
137
141
|
|
|
138
|
-
&.#{$prefix}--btn--sm {
|
|
139
|
-
padding: $button-padding-ghost-sm;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// V11: remove field
|
|
143
|
-
&.#{$prefix}--btn--field,
|
|
144
|
-
&.#{$prefix}--btn--md {
|
|
145
|
-
padding: $button-padding-ghost-field;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
142
|
&:not([disabled]) svg {
|
|
149
143
|
fill: $icon-primary;
|
|
150
144
|
}
|
|
151
145
|
}
|
|
152
146
|
|
|
153
147
|
.#{$prefix}--btn--icon-only {
|
|
154
|
-
|
|
155
|
-
|
|
148
|
+
width: layout.size('height');
|
|
149
|
+
height: layout.size('height');
|
|
150
|
+
justify-content: center;
|
|
151
|
+
padding: 0;
|
|
152
|
+
// -1px to compensate for border width
|
|
153
|
+
padding-block-start: min(
|
|
154
|
+
calc((layout.size('height') - rem(16px)) / 2 - rem(1px)),
|
|
155
|
+
var(--temp-padding-block-max)
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
> :first-child {
|
|
159
|
+
margin-block-start: rem(1px);
|
|
160
|
+
}
|
|
156
161
|
|
|
157
162
|
.#{$prefix}--btn__icon {
|
|
158
163
|
position: static;
|
|
@@ -193,16 +198,14 @@
|
|
|
193
198
|
cursor: not-allowed;
|
|
194
199
|
}
|
|
195
200
|
|
|
196
|
-
//
|
|
197
|
-
|
|
198
|
-
.#{$prefix}--
|
|
199
|
-
|
|
200
|
-
padding-left: rem(11px);
|
|
201
|
+
// Workaround to ensure onMouseEnter events fire when moving
|
|
202
|
+
// from a disabled button to a non-disabled button (#13815)
|
|
203
|
+
.#{$prefix}--icon-tooltip--disabled .#{$prefix}--tooltip-trigger__wrapper {
|
|
204
|
+
cursor: not-allowed;
|
|
201
205
|
}
|
|
202
206
|
|
|
203
|
-
.#{$prefix}--
|
|
204
|
-
|
|
205
|
-
padding-left: rem(7px);
|
|
207
|
+
.#{$prefix}--icon-tooltip--disabled .#{$prefix}--btn--icon-only[disabled] {
|
|
208
|
+
pointer-events: none;
|
|
206
209
|
}
|
|
207
210
|
|
|
208
211
|
.#{$prefix}--btn--danger {
|
|
@@ -267,7 +270,7 @@
|
|
|
267
270
|
$button-danger-active
|
|
268
271
|
);
|
|
269
272
|
|
|
270
|
-
padding:
|
|
273
|
+
padding-inline-end: calc(layout.density('padding-inline') - rem(1px));
|
|
271
274
|
|
|
272
275
|
.#{$prefix}--btn__icon {
|
|
273
276
|
position: static;
|
|
@@ -290,48 +293,12 @@
|
|
|
290
293
|
color: $text-disabled;
|
|
291
294
|
outline: none;
|
|
292
295
|
}
|
|
293
|
-
|
|
294
|
-
&.#{$prefix}--btn--sm {
|
|
295
|
-
padding: $button-padding-ghost-sm;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
// V11: Remove field
|
|
299
|
-
&.#{$prefix}--btn--field,
|
|
300
|
-
&.#{$prefix}--btn--md {
|
|
301
|
-
padding: $button-padding-ghost-field;
|
|
302
|
-
}
|
|
303
296
|
}
|
|
304
297
|
}
|
|
305
298
|
|
|
306
|
-
.#{$prefix}--btn--sm {
|
|
307
|
-
min-height: rem(32px);
|
|
308
|
-
padding: $button-padding-sm;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
.#{$prefix}--btn--2xl:not(.#{$prefix}--btn--icon-only) {
|
|
312
|
-
@include button-padding-large;
|
|
313
|
-
|
|
314
|
-
min-height: rem(80px);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.#{$prefix}--btn--xl:not(.#{$prefix}--btn--icon-only) {
|
|
318
|
-
@include button-padding-large;
|
|
319
|
-
|
|
320
|
-
min-height: rem(64px);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
// V11: Remove field
|
|
324
|
-
.#{$prefix}--btn--field,
|
|
325
|
-
.#{$prefix}--btn--md {
|
|
326
|
-
min-height: rem(40px);
|
|
327
|
-
padding: $button-padding-field;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
299
|
//expressive styles
|
|
331
300
|
.#{$prefix}--btn--expressive {
|
|
332
301
|
@include type-style('body-compact-02');
|
|
333
|
-
|
|
334
|
-
min-height: 3rem;
|
|
335
302
|
}
|
|
336
303
|
|
|
337
304
|
.#{$prefix}--btn--icon-only.#{$prefix}--btn--expressive {
|
|
@@ -14,11 +14,19 @@
|
|
|
14
14
|
@use '../../utilities/component-reset';
|
|
15
15
|
@use '../../utilities/convert' as *;
|
|
16
16
|
@use '../../utilities/custom-property';
|
|
17
|
+
@use '../../utilities/layout';
|
|
17
18
|
@use 'tokens' as *;
|
|
18
19
|
|
|
19
20
|
$button-focus-color: custom-property.get-var('button-focus-color', $focus);
|
|
20
21
|
|
|
21
22
|
@mixin button-base {
|
|
23
|
+
// https://caniuse.com/mdn-css_types_length_lh
|
|
24
|
+
--temp-1lh: (var(--#{$prefix}-body-compact-01-line-height) * 1em);
|
|
25
|
+
// -1px to compensate for border width
|
|
26
|
+
--temp-padding-block-max: calc(
|
|
27
|
+
(var(--#{$prefix}-layout-size-height-lg) - var(--temp-1lh)) / 2 - #{rem(1px)}
|
|
28
|
+
);
|
|
29
|
+
|
|
22
30
|
@include component-reset.reset;
|
|
23
31
|
@include type-style('body-compact-01');
|
|
24
32
|
|
|
@@ -26,16 +34,23 @@ $button-focus-color: custom-property.get-var('button-focus-color', $focus);
|
|
|
26
34
|
display: inline-flex;
|
|
27
35
|
width: max-content;
|
|
28
36
|
max-width: rem(320px);
|
|
29
|
-
|
|
37
|
+
height: layout.size('height');
|
|
30
38
|
flex-shrink: 0;
|
|
31
|
-
align-items: center;
|
|
32
39
|
justify-content: space-between;
|
|
33
|
-
padding: $button-padding;
|
|
34
40
|
// Fix to remove added margins on buttons in safari (see #5155)
|
|
35
41
|
margin: 0;
|
|
36
42
|
border-radius: $button-border-radius;
|
|
37
43
|
cursor: pointer;
|
|
38
44
|
outline: none;
|
|
45
|
+
// -1px to compensate for border width
|
|
46
|
+
padding-block-start: min(
|
|
47
|
+
calc((layout.size('height') - var(--temp-1lh)) / 2 - rem(1px)),
|
|
48
|
+
var(--temp-padding-block-max)
|
|
49
|
+
);
|
|
50
|
+
padding-inline-end: calc(
|
|
51
|
+
layout.density('padding-inline') * 3 + rem(16px) - rem(1px)
|
|
52
|
+
);
|
|
53
|
+
padding-inline-start: calc(layout.density('padding-inline') - rem(1px));
|
|
39
54
|
text-align: left;
|
|
40
55
|
text-decoration: none;
|
|
41
56
|
transition: background $duration-fast-01 motion(entrance, productive),
|
|
@@ -59,10 +74,16 @@ $button-focus-color: custom-property.get-var('button-focus-color', $focus);
|
|
|
59
74
|
|
|
60
75
|
.#{$prefix}--btn__icon {
|
|
61
76
|
position: absolute;
|
|
62
|
-
|
|
77
|
+
// -1px to compensate for border width
|
|
78
|
+
top: min(
|
|
79
|
+
calc((layout.size('height') - rem(16px)) / 2 - rem(1px)),
|
|
80
|
+
var(--temp-padding-block-max)
|
|
81
|
+
);
|
|
82
|
+
right: layout.density('padding-inline');
|
|
63
83
|
width: rem(16px);
|
|
64
84
|
height: rem(16px);
|
|
65
85
|
flex-shrink: 0;
|
|
86
|
+
margin-block-start: rem(1px);
|
|
66
87
|
}
|
|
67
88
|
}
|
|
68
89
|
|
|
@@ -265,13 +265,15 @@ $copy-btn-feedback: $background-inverse !default;
|
|
|
265
265
|
transition: all $duration-fast-01 motion(standard, productive);
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
+
.#{$prefix}--btn > .#{$prefix}--snippet__icon {
|
|
269
|
+
margin-block-start: 0;
|
|
270
|
+
}
|
|
271
|
+
|
|
268
272
|
.#{$prefix}--copy-btn {
|
|
269
273
|
@include reset;
|
|
270
274
|
|
|
271
275
|
display: flex;
|
|
272
276
|
overflow: visible;
|
|
273
|
-
width: $spacing-08;
|
|
274
|
-
height: $spacing-08;
|
|
275
277
|
align-items: center;
|
|
276
278
|
justify-content: center;
|
|
277
279
|
padding: 0;
|
|
@@ -298,17 +300,14 @@ $copy-btn-feedback: $background-inverse !default;
|
|
|
298
300
|
|
|
299
301
|
// Overrides for codesnippet copy btn
|
|
300
302
|
// TLDR: Copy/CopyButton now uses IconButton, which uses Carbon buttons under the hood
|
|
301
|
-
// v10
|
|
302
|
-
.#{$prefix}--snippet--inline.#{$prefix}--btn
|
|
303
|
-
|
|
304
|
-
|
|
303
|
+
// v10 Copy just used native html button so it didn't have extra carbon styles that needed overriding
|
|
304
|
+
.#{$prefix}--snippet--inline.#{$prefix}--btn {
|
|
305
|
+
width: initial;
|
|
306
|
+
height: 1.25rem;
|
|
307
|
+
padding-inline: 0;
|
|
305
308
|
}
|
|
306
309
|
|
|
307
|
-
.#{$prefix}--snippet--inline.#{$prefix}--btn--
|
|
308
|
-
min-height: 1.25rem;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
.#{$prefix}--snippet--inline.#{$prefix}--btn--primary:hover {
|
|
310
|
+
.#{$prefix}--snippet--inline.#{$prefix}--btn.#{$prefix}--btn--primary:hover {
|
|
312
311
|
color: $text-primary;
|
|
313
312
|
}
|
|
314
313
|
|
|
@@ -319,12 +318,8 @@ $copy-btn-feedback: $background-inverse !default;
|
|
|
319
318
|
right: 0.5rem;
|
|
320
319
|
}
|
|
321
320
|
|
|
322
|
-
.#{$prefix}--snippet--multi .#{$prefix}--copy-btn
|
|
321
|
+
.#{$prefix}--snippet--multi .#{$prefix}--copy-btn {
|
|
323
322
|
z-index: 10;
|
|
324
|
-
width: $spacing-07;
|
|
325
|
-
height: $spacing-07;
|
|
326
|
-
min-height: $spacing-07;
|
|
327
|
-
padding: 0;
|
|
328
323
|
}
|
|
329
324
|
|
|
330
325
|
// Show more / less button
|
|
@@ -12,21 +12,27 @@
|
|
|
12
12
|
@use '../../spacing' as *;
|
|
13
13
|
@use '../../theme' as *;
|
|
14
14
|
@use '../../type' as *;
|
|
15
|
+
@use '../../utilities/button-reset';
|
|
15
16
|
@use '../../utilities/convert' as *;
|
|
16
17
|
@use '../../utilities/focus-outline' as *;
|
|
17
|
-
@use '../../utilities/
|
|
18
|
+
@use '../../utilities/layout';
|
|
18
19
|
|
|
19
20
|
/// Contained List styles
|
|
20
21
|
/// @access public
|
|
21
22
|
/// @group contained-list
|
|
22
23
|
@mixin contained-list {
|
|
24
|
+
.#{$prefix}--contained-list {
|
|
25
|
+
@include layout.use('size', $default: 'lg', $min: 'sm', $max: 'xl');
|
|
26
|
+
@include layout.use('density', $default: 'normal');
|
|
27
|
+
}
|
|
28
|
+
|
|
23
29
|
.#{$prefix}--contained-list__header {
|
|
24
30
|
position: sticky;
|
|
25
31
|
z-index: 1;
|
|
26
32
|
top: 0;
|
|
27
33
|
display: flex;
|
|
28
34
|
align-items: center;
|
|
29
|
-
padding-inline:
|
|
35
|
+
padding-inline: layout.density('padding-inline');
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
.#{$prefix}--contained-list__label {
|
|
@@ -36,7 +42,7 @@
|
|
|
36
42
|
.#{$prefix}--contained-list .#{$prefix}--search {
|
|
37
43
|
position: sticky;
|
|
38
44
|
z-index: 1;
|
|
39
|
-
top:
|
|
45
|
+
top: layout.size('height');
|
|
40
46
|
|
|
41
47
|
&.#{$prefix}--search--expandable .#{$prefix}--search-input {
|
|
42
48
|
background-color: $field;
|
|
@@ -79,35 +85,6 @@
|
|
|
79
85
|
outline: none;
|
|
80
86
|
}
|
|
81
87
|
|
|
82
|
-
// Sizes
|
|
83
|
-
|
|
84
|
-
$sizes: (
|
|
85
|
-
// size: (height, item-block-padding)
|
|
86
|
-
'sm': (rem(32px), $spacing-03),
|
|
87
|
-
'md': (rem(40px), $spacing-04),
|
|
88
|
-
'lg': (rem(48px), $spacing-05),
|
|
89
|
-
'xl': (rem(64px), $spacing-06)
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
@each $size, $definition in $sizes {
|
|
93
|
-
$height: list.nth($definition, 1);
|
|
94
|
-
$item-block-padding: list.nth($definition, 2);
|
|
95
|
-
|
|
96
|
-
.#{$prefix}--contained-list--on-page.#{$prefix}--contained-list--#{$size}
|
|
97
|
-
.#{$prefix}--contained-list__header {
|
|
98
|
-
height: $height;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.#{$prefix}--contained-list--#{$size}
|
|
102
|
-
.#{$prefix}--contained-list-item__content,
|
|
103
|
-
.#{$prefix}--contained-list--#{$size}
|
|
104
|
-
.#{$prefix}--contained-list-item--clickable
|
|
105
|
-
.#{$prefix}--contained-list-item__content {
|
|
106
|
-
min-height: $height;
|
|
107
|
-
padding: calc(#{$item-block-padding} - #{rem(2px)}) $spacing-05;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
88
|
// "On Page" variant
|
|
112
89
|
|
|
113
90
|
.#{$prefix}--contained-list--on-page + .#{$prefix}--contained-list--on-page {
|
|
@@ -117,6 +94,7 @@
|
|
|
117
94
|
.#{$prefix}--contained-list--on-page .#{$prefix}--contained-list__header {
|
|
118
95
|
@include type-style('heading-compact-01');
|
|
119
96
|
|
|
97
|
+
height: layout.size('height');
|
|
120
98
|
border-bottom: 1px solid $border-subtle;
|
|
121
99
|
background-color: $background;
|
|
122
100
|
color: $text-primary;
|
|
@@ -166,8 +144,14 @@
|
|
|
166
144
|
.#{$prefix}--contained-list-item__content,
|
|
167
145
|
.#{$prefix}--contained-list-item--clickable
|
|
168
146
|
.#{$prefix}--contained-list-item__content {
|
|
147
|
+
// https://caniuse.com/mdn-css_types_length_lh
|
|
148
|
+
--temp-1lh: (var(--#{$prefix}-body-01-line-height) * 1em);
|
|
149
|
+
|
|
169
150
|
@include type-style('body-01');
|
|
170
151
|
|
|
152
|
+
min-height: layout.size('height');
|
|
153
|
+
padding: calc(calc((#{layout.size('height')} - var(--temp-1lh)) / 2))
|
|
154
|
+
layout.density('padding-inline');
|
|
171
155
|
color: $text-primary;
|
|
172
156
|
}
|
|
173
157
|
|
|
@@ -183,8 +167,8 @@
|
|
|
183
167
|
|
|
184
168
|
.#{$prefix}--contained-list--inset-rulers
|
|
185
169
|
.#{$prefix}--contained-list-item:not(:last-of-type)::before {
|
|
186
|
-
right:
|
|
187
|
-
left:
|
|
170
|
+
right: layout.density('padding-inline');
|
|
171
|
+
left: layout.density('padding-inline');
|
|
188
172
|
}
|
|
189
173
|
|
|
190
174
|
.#{$prefix}--contained-list-item--clickable
|
|
@@ -13,23 +13,19 @@
|
|
|
13
13
|
@use '../../utilities/convert' as *;
|
|
14
14
|
@use '../../utilities/focus-outline' as *;
|
|
15
15
|
@use '../../utilities/high-contrast-mode' as *;
|
|
16
|
+
@use '../../utilities/layout';
|
|
16
17
|
|
|
17
18
|
@mixin content-switcher {
|
|
18
19
|
.#{$prefix}--content-switcher {
|
|
20
|
+
@include layout.use('size', $default: 'md', $min: 'sm', $max: 'lg');
|
|
21
|
+
@include layout.use('density', $default: 'normal');
|
|
22
|
+
|
|
19
23
|
display: flex;
|
|
20
24
|
width: 100%;
|
|
21
|
-
height:
|
|
25
|
+
height: layout.size('height');
|
|
22
26
|
justify-content: space-evenly;
|
|
23
27
|
}
|
|
24
28
|
|
|
25
|
-
.#{$prefix}--content-switcher--sm {
|
|
26
|
-
height: rem(32px);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.#{$prefix}--content-switcher--lg {
|
|
30
|
-
height: rem(48px);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
29
|
.#{$prefix}--content-switcher-btn {
|
|
34
30
|
@include reset;
|
|
35
31
|
@include font-family('sans');
|
|
@@ -39,9 +35,6 @@
|
|
|
39
35
|
position: relative;
|
|
40
36
|
display: inline-flex;
|
|
41
37
|
overflow: hidden;
|
|
42
|
-
width: 100%;
|
|
43
|
-
align-items: center;
|
|
44
|
-
padding: $spacing-03 $spacing-05;
|
|
45
38
|
border: none;
|
|
46
39
|
border-top: rem(1px) solid $border-inverse;
|
|
47
40
|
border-bottom: rem(1px) solid $border-inverse;
|
|
@@ -113,6 +106,13 @@
|
|
|
113
106
|
}
|
|
114
107
|
}
|
|
115
108
|
|
|
109
|
+
.#{$prefix}--content-switcher:not(.#{$prefix}--content-switcher--icon-only)
|
|
110
|
+
.#{$prefix}--content-switcher-btn {
|
|
111
|
+
width: 100%;
|
|
112
|
+
align-items: center;
|
|
113
|
+
padding: $spacing-03 layout.density('padding-inline');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
116
|
.#{$prefix}--content-switcher:not(.#{$prefix}--content-switcher--icon-only)
|
|
117
117
|
.#{$prefix}--content-switcher-btn:first-child {
|
|
118
118
|
border-left: rem(1px) solid $border-inverse;
|