@carbon/styles 1.82.0-rc.0 → 1.83.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/styles.css +686 -328
- package/css/styles.min.css +1 -1
- package/package.json +9 -9
- package/scss/__tests__/theme-test.js +4 -0
- package/scss/_layer.scss +7 -0
- package/scss/_reset.scss +2 -1
- package/scss/_theme.scss +49 -0
- package/scss/_zone.scss +3 -1
- package/scss/components/accordion/_accordion.scss +0 -7
- package/scss/components/breadcrumb/_breadcrumb.scss +1 -1
- package/scss/components/button/_button.scss +0 -9
- package/scss/components/checkbox/_checkbox.scss +17 -0
- package/scss/components/code-snippet/_code-snippet.scss +0 -5
- package/scss/components/content-switcher/_content-switcher.scss +424 -54
- package/scss/components/content-switcher/_index.scss +6 -1
- package/scss/components/content-switcher/_tokens.scss +110 -0
- package/scss/components/data-table/_data-table.scss +2 -1
- package/scss/components/data-table/expandable/_data-table-expandable.scss +0 -4
- package/scss/components/data-table/sort/_data-table-sort.scss +0 -7
- package/scss/components/date-picker/_date-picker.scss +0 -7
- package/scss/components/date-picker/_flatpickr.scss +0 -2
- package/scss/components/dialog/_dialog.scss +160 -13
- package/scss/components/dropdown/_dropdown.scss +0 -4
- package/scss/components/file-uploader/_file-uploader.scss +1 -5
- package/scss/components/fluid-number-input/_fluid-number-input.scss +103 -5
- package/scss/components/form/_form.scss +3 -1
- package/scss/components/list-box/_list-box.scss +0 -6
- package/scss/components/modal/_modal.scss +0 -5
- package/scss/components/notification/_actionable-notification.scss +0 -7
- package/scss/components/notification/_inline-notification.scss +0 -8
- package/scss/components/notification/_toast-notification.scss +0 -6
- package/scss/components/number-input/_number-input.scss +87 -18
- package/scss/components/overflow-menu/_overflow-menu.scss +0 -4
- package/scss/components/page-header/_page-header.scss +60 -19
- package/scss/components/pagination-nav/_pagination-nav.scss +0 -1
- package/scss/components/popover/_popover.scss +0 -1
- package/scss/components/radio-button/_radio-button.scss +1 -1
- package/scss/components/search/_search.scss +0 -7
- package/scss/components/select/_select.scss +0 -7
- package/scss/components/structured-list/_structured-list.scss +0 -8
- package/scss/components/tabs/_tabs.scss +6 -4
- package/scss/components/tag/_tag.scss +0 -5
- package/scss/components/text-input/_text-input.scss +0 -18
- package/scss/components/tile/_tile.scss +0 -22
- package/scss/components/ui-shell/side-nav/_side-nav.scss +0 -13
- package/scss/layer/_layer-sets.scss +5 -0
- package/scss/theme/_theme.scss +1 -0
- package/scss/utilities/_high-contrast-mode.scss +0 -4
- package/scss/utilities/_layout.scss +2 -1
- package/scss/utilities/_update_fields_on_layer.scss +1 -0
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.83.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@carbon/colors": "^11.
|
|
44
|
-
"@carbon/feature-flags": "^0.
|
|
45
|
-
"@carbon/grid": "^11.
|
|
46
|
-
"@carbon/layout": "^11.
|
|
47
|
-
"@carbon/motion": "^11.
|
|
48
|
-
"@carbon/themes": "^11.
|
|
49
|
-
"@carbon/type": "^11.
|
|
43
|
+
"@carbon/colors": "^11.34.0-rc.0",
|
|
44
|
+
"@carbon/feature-flags": "^0.27.0-rc.0",
|
|
45
|
+
"@carbon/grid": "^11.37.0-rc.0",
|
|
46
|
+
"@carbon/layout": "^11.35.0-rc.0",
|
|
47
|
+
"@carbon/motion": "^11.29.0-rc.0",
|
|
48
|
+
"@carbon/themes": "^11.54.0-rc.0",
|
|
49
|
+
"@carbon/type": "^11.41.0-rc.0",
|
|
50
50
|
"@ibm/plex": "6.0.0-next.6",
|
|
51
51
|
"@ibm/plex-mono": "0.0.3-alpha.0",
|
|
52
52
|
"@ibm/plex-sans": "0.0.3-alpha.0",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"scss/**/*.css",
|
|
76
76
|
"css/**/*.css"
|
|
77
77
|
],
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "fcae2645f1b5a1a01b5629926df471ec1945d1e6"
|
|
79
79
|
}
|
|
@@ -46,16 +46,19 @@ describe('@carbon/styles/scss/theme', () => {
|
|
|
46
46
|
"background-inverse-hover",
|
|
47
47
|
"layer-01",
|
|
48
48
|
"layer-active-01",
|
|
49
|
+
"layer-background-01",
|
|
49
50
|
"layer-hover-01",
|
|
50
51
|
"layer-selected-01",
|
|
51
52
|
"layer-selected-hover-01",
|
|
52
53
|
"layer-02",
|
|
53
54
|
"layer-active-02",
|
|
55
|
+
"layer-background-02",
|
|
54
56
|
"layer-hover-02",
|
|
55
57
|
"layer-selected-02",
|
|
56
58
|
"layer-selected-hover-02",
|
|
57
59
|
"layer-03",
|
|
58
60
|
"layer-active-03",
|
|
61
|
+
"layer-background-03",
|
|
59
62
|
"layer-hover-03",
|
|
60
63
|
"layer-selected-03",
|
|
61
64
|
"layer-selected-hover-03",
|
|
@@ -177,6 +180,7 @@ describe('@carbon/styles/scss/theme', () => {
|
|
|
177
180
|
"skeleton-element",
|
|
178
181
|
"layer",
|
|
179
182
|
"layer-active",
|
|
183
|
+
"layer-background",
|
|
180
184
|
"layer-hover",
|
|
181
185
|
"layer-selected",
|
|
182
186
|
"layer-selected-hover",
|
package/scss/_layer.scss
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
@forward './layer/layer-sets';
|
|
9
9
|
@use './config' as *;
|
|
10
10
|
@use './layer/layer-tokens';
|
|
11
|
+
@use './theme' as *;
|
|
11
12
|
|
|
12
13
|
:root {
|
|
13
14
|
@include layer-tokens.emit-layer-tokens(1);
|
|
@@ -24,3 +25,9 @@
|
|
|
24
25
|
.#{$prefix}--layer-three {
|
|
25
26
|
@include layer-tokens.emit-layer-tokens(3);
|
|
26
27
|
}
|
|
28
|
+
|
|
29
|
+
@each $i in (one, two, three) {
|
|
30
|
+
.#{$prefix}--layer-#{$i}.#{$prefix}--layer__with-background {
|
|
31
|
+
background-color: $layer-background;
|
|
32
|
+
}
|
|
33
|
+
}
|
package/scss/_reset.scss
CHANGED
|
@@ -172,7 +172,8 @@
|
|
|
172
172
|
|
|
173
173
|
@include type.reset();
|
|
174
174
|
|
|
175
|
-
/// Makes SVGs accessible in high contrast mode
|
|
175
|
+
/// Makes SVGs accessible in high contrast mode, although it only works sporadically as other CSS selectors
|
|
176
|
+
/// routinely override this one.
|
|
176
177
|
/// @link https://github.com/IBM/carbon-elements/issues/345#issuecomment-466577293 Carbon-elements #345
|
|
177
178
|
@media screen and (-ms-high-contrast: active) {
|
|
178
179
|
svg {
|
package/scss/_theme.scss
CHANGED
|
@@ -8,12 +8,61 @@
|
|
|
8
8
|
@forward './theme/theme' hide theme;
|
|
9
9
|
@use './theme/theme';
|
|
10
10
|
@use './layer/layer-tokens';
|
|
11
|
+
@use './utilities/custom-property';
|
|
11
12
|
|
|
12
13
|
/// Include the CSS Custom Properties for the active theme or a given theme on
|
|
13
14
|
/// a selector
|
|
14
15
|
@mixin theme($args...) {
|
|
15
16
|
@include theme.theme($args...);
|
|
16
17
|
|
|
18
|
+
// If the system is in high-contrast mode, use the system defined colors. This mostly happens automatically, but
|
|
19
|
+
// we need to do it manually for icons and selected backgrounds. Importantly, the custom properties we set here
|
|
20
|
+
// need to override the CSS custom properties set above. See:
|
|
21
|
+
// - https://github.com/carbon-design-system/carbon/issues/19015
|
|
22
|
+
// - https://developer.mozilla.org/en-US/docs/Web/CSS/system-color.
|
|
23
|
+
// - https://carbondesignsystem.com/elements/color/tokens/#icon
|
|
24
|
+
@media screen and (-ms-high-contrast: active), (forced-colors: active) {
|
|
25
|
+
// Icon colors specified by "fill".
|
|
26
|
+
@include custom-property.declaration('icon-primary', ButtonText);
|
|
27
|
+
@include custom-property.declaration('icon-secondary', ButtonText);
|
|
28
|
+
@include custom-property.declaration('icon-interactive', ButtonText);
|
|
29
|
+
@include custom-property.declaration('icon-disabled', GrayText);
|
|
30
|
+
@include custom-property.declaration('icon-on-color-disabled', GrayText);
|
|
31
|
+
|
|
32
|
+
// Since icon-inverse and icon-on-color are generally used to indicated selected icons, use SelectedItemText.
|
|
33
|
+
@include custom-property.declaration('icon-inverse', SelectedItemText);
|
|
34
|
+
@include custom-property.declaration('icon-on-color', SelectedItemText);
|
|
35
|
+
|
|
36
|
+
// Some components currently set these values for fill, although unclear if that's valid.
|
|
37
|
+
@include custom-property.declaration('button-disabled', GrayText);
|
|
38
|
+
@include custom-property.declaration('interactive', ButtonText);
|
|
39
|
+
@include custom-property.declaration('link-primary', LinkText);
|
|
40
|
+
@include custom-property.declaration('link-primary-hover', LinkText);
|
|
41
|
+
@include custom-property.declaration('link-secondary', LinkText);
|
|
42
|
+
@include custom-property.declaration('link-inverse', SelectedItemText);
|
|
43
|
+
@include custom-property.declaration(
|
|
44
|
+
'link-inverse-hover',
|
|
45
|
+
SelectedItemText
|
|
46
|
+
);
|
|
47
|
+
@include custom-property.declaration(
|
|
48
|
+
'link-inverse-visited',
|
|
49
|
+
SelectedItemText
|
|
50
|
+
);
|
|
51
|
+
@include custom-property.declaration('link-visited', VisitedText);
|
|
52
|
+
|
|
53
|
+
// Force a background-color for selected buttons etc., otherwise the user won't know they are selected.
|
|
54
|
+
@include custom-property.declaration('background-selected', SelectedItem);
|
|
55
|
+
@include custom-property.declaration(
|
|
56
|
+
'background-selected-hover',
|
|
57
|
+
SelectedItem
|
|
58
|
+
);
|
|
59
|
+
@include custom-property.declaration('background-inverse', SelectedItem);
|
|
60
|
+
@include custom-property.declaration(
|
|
61
|
+
'layer-selected-inverse',
|
|
62
|
+
SelectedItem
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
17
66
|
// Note: we need to re-emit the contextual layer tokens as part of the theme
|
|
18
67
|
// mixin. Otherwise, the layer tokens are defined at the :root level and will
|
|
19
68
|
// not pick up the theme-specific, or zone-specific, value from the first
|
package/scss/_zone.scss
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
@use './components/notification/tokens' as notification;
|
|
19
19
|
@use './components/tag/tokens' as tag;
|
|
20
20
|
@use './components/icon-indicator/tokens' as icon-indicator;
|
|
21
|
+
@use './components/content-switcher/tokens' as content-switcher;
|
|
21
22
|
|
|
22
23
|
/// Specify a Map of zones where the key will be used as part of the selector
|
|
23
24
|
/// and the value will be a map used to emit CSS Custom Properties for all color
|
|
@@ -33,7 +34,8 @@ $-components: (
|
|
|
33
34
|
button.$button-tokens,
|
|
34
35
|
notification.$notification-tokens,
|
|
35
36
|
tag.$tag-tokens,
|
|
36
|
-
icon-indicator.$status-tokens
|
|
37
|
+
icon-indicator.$status-tokens,
|
|
38
|
+
content-switcher.$content-switcher-tokens
|
|
37
39
|
);
|
|
38
40
|
|
|
39
41
|
@each $name, $theme in $zones {
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
@use '../../utilities/convert';
|
|
18
18
|
@use '../../utilities/layout';
|
|
19
19
|
@use '../../utilities/focus-outline' as *;
|
|
20
|
-
@use '../../utilities/high-contrast-mode' as *;
|
|
21
20
|
|
|
22
21
|
/// @type Value
|
|
23
22
|
/// @access public
|
|
@@ -385,12 +384,6 @@ $content-padding: 0 0 0 $spacing-05 !default;
|
|
|
385
384
|
margin-inline-start: $spacing-05;
|
|
386
385
|
}
|
|
387
386
|
|
|
388
|
-
// Windows HCM fix
|
|
389
|
-
.#{$prefix}--accordion__arrow,
|
|
390
|
-
.#{$prefix}--accordion__item--active .#{$prefix}--accordion__arrow {
|
|
391
|
-
@include high-contrast-mode('icon-fill');
|
|
392
|
-
}
|
|
393
|
-
|
|
394
387
|
// RTL overrides
|
|
395
388
|
[dir='rtl'] .#{$prefix}--accordion--start .#{$prefix}--accordion__heading {
|
|
396
389
|
padding-inline: layout.density('padding-inline') 0;
|
|
@@ -421,15 +421,6 @@
|
|
|
421
421
|
@include high-contrast-mode('focus');
|
|
422
422
|
}
|
|
423
423
|
|
|
424
|
-
// Windows HCM fix
|
|
425
|
-
|
|
426
|
-
.#{$prefix}--btn--ghost.#{$prefix}--btn--icon-only
|
|
427
|
-
.#{$prefix}--btn__icon
|
|
428
|
-
path:not([data-icon-path]):not([fill='none']),
|
|
429
|
-
.#{$prefix}--btn--ghost.#{$prefix}--btn--icon-only .#{$prefix}--btn__icon {
|
|
430
|
-
@include high-contrast-mode('icon-fill');
|
|
431
|
-
}
|
|
432
|
-
|
|
433
424
|
// RTL overrides
|
|
434
425
|
[dir='rtl'] .#{$prefix}--btn-set .#{$prefix}--btn:not(:focus) {
|
|
435
426
|
box-shadow: convert.to-rem(1px) 0 0 0 $button-separator;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
@use '../../type' as *;
|
|
13
13
|
@use '../../utilities/component-reset';
|
|
14
14
|
@use '../../utilities/convert';
|
|
15
|
+
@use '../../utilities/high-contrast-mode' as *;
|
|
15
16
|
@use '../../utilities/skeleton' as *;
|
|
16
17
|
@use '../../utilities/visually-hidden' as *;
|
|
17
18
|
|
|
@@ -91,6 +92,9 @@
|
|
|
91
92
|
position: absolute;
|
|
92
93
|
border: 1px solid $icon-primary;
|
|
93
94
|
border-radius: 2px;
|
|
95
|
+
@include high-contrast-mode {
|
|
96
|
+
border: 1px solid ButtonBorder;
|
|
97
|
+
}
|
|
94
98
|
|
|
95
99
|
// Checkboxes with a background color look visually off against a parent container.
|
|
96
100
|
background-color: transparent;
|
|
@@ -136,6 +140,13 @@
|
|
|
136
140
|
border: none;
|
|
137
141
|
border-width: 1px;
|
|
138
142
|
background-color: $icon-primary;
|
|
143
|
+
|
|
144
|
+
// According to https://developer.mozilla.org/en-US/docs/Web/CSS/system-color, in high contrast mode, the
|
|
145
|
+
// checkbox should be displayed using SelectedItem and SelectedItemText.
|
|
146
|
+
@include high-contrast-mode {
|
|
147
|
+
border: 1px solid ButtonBorder;
|
|
148
|
+
background-color: SelectedItem;
|
|
149
|
+
}
|
|
139
150
|
}
|
|
140
151
|
|
|
141
152
|
// Display the check
|
|
@@ -326,6 +337,12 @@
|
|
|
326
337
|
.#{$prefix}--checkbox:checked
|
|
327
338
|
+ .#{$prefix}--checkbox-label::after {
|
|
328
339
|
border-color: $text-primary;
|
|
340
|
+
|
|
341
|
+
// According to https://developer.mozilla.org/en-US/docs/Web/CSS/system-color, in high contrast mode, the
|
|
342
|
+
// checkbox should be displayed using SelectedItem and SelectedItemText.
|
|
343
|
+
@include high-contrast-mode {
|
|
344
|
+
fill: SelectedItemText;
|
|
345
|
+
}
|
|
329
346
|
}
|
|
330
347
|
|
|
331
348
|
//-----------------------------------------------
|
|
@@ -555,11 +555,6 @@ $copy-btn-feedback: $background-inverse !default;
|
|
|
555
555
|
}
|
|
556
556
|
|
|
557
557
|
// Windows HCM fix
|
|
558
|
-
|
|
559
|
-
.#{$prefix}--snippet__icon {
|
|
560
|
-
@include high-contrast-mode('icon-fill');
|
|
561
|
-
}
|
|
562
|
-
|
|
563
558
|
.#{$prefix}--snippet--inline:focus {
|
|
564
559
|
@include high-contrast-mode('focus');
|
|
565
560
|
}
|