@carbon/element-styles 0.2.0-rc.2
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/LICENSE +201 -0
- package/README.md +281 -0
- package/package.json +40 -0
- package/src/_config.scss +8 -0
- package/src/elements/_heading/index.scss +27 -0
- package/src/elements/_input/index.scss +92 -0
- package/src/elements/_labelled-input/index.scss +143 -0
- package/src/elements/_layer/index.scss +78 -0
- package/src/elements/abbreviation/index.scss +31 -0
- package/src/elements/address/index.scss +31 -0
- package/src/elements/anchor/index.scss +50 -0
- package/src/elements/block-quotation/index.scss +63 -0
- package/src/elements/body/index.scss +30 -0
- package/src/elements/bold-text/index.scss +27 -0
- package/src/elements/button/index.scss +235 -0
- package/src/elements/checkbox/index.scss +76 -0
- package/src/elements/code/index.scss +34 -0
- package/src/elements/combo-box/index.scss +68 -0
- package/src/elements/date-input/index.scss +47 -0
- package/src/elements/date-time-input/index.scss +47 -0
- package/src/elements/deleted-text/index.scss +33 -0
- package/src/elements/description-list/index.scss +42 -0
- package/src/elements/details/index.scss +85 -0
- package/src/elements/dialog/index.scss +211 -0
- package/src/elements/fieldset/index.scss +41 -0
- package/src/elements/file-input/index.scss +84 -0
- package/src/elements/footer/index.scss +34 -0
- package/src/elements/header-navigation/index.scss +125 -0
- package/src/elements/heading-level-1/index.scss +30 -0
- package/src/elements/heading-level-2/index.scss +30 -0
- package/src/elements/heading-level-3/index.scss +30 -0
- package/src/elements/heading-level-4/index.scss +30 -0
- package/src/elements/heading-level-5/index.scss +30 -0
- package/src/elements/heading-level-6/index.scss +30 -0
- package/src/elements/horizontal-rule/index.scss +41 -0
- package/src/elements/inline-loading/index.scss +70 -0
- package/src/elements/inline-quotation/index.scss +28 -0
- package/src/elements/inserted-text/index.scss +34 -0
- package/src/elements/italic-text/index.scss +27 -0
- package/src/elements/keyboard-input/index.scss +34 -0
- package/src/elements/label/index.scss +52 -0
- package/src/elements/main/index.scss +32 -0
- package/src/elements/marked-text/index.scss +33 -0
- package/src/elements/menu/index.scss +106 -0
- package/src/elements/number-input/index.scss +37 -0
- package/src/elements/ordered-list/index.scss +50 -0
- package/src/elements/paragraph/index.scss +30 -0
- package/src/elements/password-input/index.scss +38 -0
- package/src/elements/popover/index.scss +71 -0
- package/src/elements/preformatted/index.scss +43 -0
- package/src/elements/progress-bar/index.scss +86 -0
- package/src/elements/radio-button/index.scss +67 -0
- package/src/elements/range-input/index.scss +76 -0
- package/src/elements/search-input/index.scss +47 -0
- package/src/elements/select/index.scss +71 -0
- package/src/elements/side-navigation/index.scss +141 -0
- package/src/elements/small-text/index.scss +31 -0
- package/src/elements/table/index.scss +131 -0
- package/src/elements/tabs/index.scss +214 -0
- package/src/elements/text-area/index.scss +43 -0
- package/src/elements/text-input/index.scss +40 -0
- package/src/elements/tile/index.scss +72 -0
- package/src/elements/time-input/index.scss +47 -0
- package/src/elements/toggle/index.scss +106 -0
- package/src/elements/tooltip/index.scss +44 -0
- package/src/elements/tree-view/index.scss +127 -0
- package/src/elements/unordered-list/index.scss +46 -0
- package/src/index.scss +10 -0
- package/src/layout/_density.scss +27 -0
- package/src/layout/_mode.scss +349 -0
- package/src/layout/_size.scss +54 -0
- package/src/layout/index.scss +10 -0
- package/src/prebuilt/editorial.scss +94 -0
- package/src/prebuilt/expressive.scss +153 -0
- package/src/prebuilt/productive.scss +153 -0
- package/src/utilities/_carbon.scss +96 -0
- package/src/utilities/_icons.scss +111 -0
- package/src/utilities/_tokens.scss +35 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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
|
+
|
|
10
|
+
@use '@carbon/styles/scss/theme';
|
|
11
|
+
@use '@carbon/styles/scss/spacing';
|
|
12
|
+
|
|
13
|
+
@use '../../layout';
|
|
14
|
+
|
|
15
|
+
$config: () !default;
|
|
16
|
+
|
|
17
|
+
$-default-config: (
|
|
18
|
+
selector: 'label',
|
|
19
|
+
axis: 'block',
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
/// @group label
|
|
23
|
+
/// @param {Map} config [()]
|
|
24
|
+
/// @param {Selector} config.selector ['label']
|
|
25
|
+
/// @param {'block' | 'axis'} config.axis ['block']
|
|
26
|
+
@mixin styles($config: $config) {
|
|
27
|
+
$props: map.deep-merge($-default-config, $config);
|
|
28
|
+
|
|
29
|
+
#{map.get($props, 'selector')} {
|
|
30
|
+
display: grid;
|
|
31
|
+
gap: spacing.$spacing-03;
|
|
32
|
+
color: theme.$text-secondary;
|
|
33
|
+
|
|
34
|
+
&:has([disabled]) {
|
|
35
|
+
color: theme.$text-disabled;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@if map.get($props, 'axis') == 'block' {
|
|
39
|
+
@include layout.mode--label;
|
|
40
|
+
// flex-direction: column;
|
|
41
|
+
grid-auto-flow: row;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@if map.get($props, 'axis') == 'inline' {
|
|
45
|
+
@include layout.mode--body-compact;
|
|
46
|
+
// flex-direction: row;
|
|
47
|
+
grid-auto-flow: column;
|
|
48
|
+
align-items: center;
|
|
49
|
+
inline-size: fit-content;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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
|
+
|
|
10
|
+
@use '@carbon/styles/scss/theme';
|
|
11
|
+
@use '@carbon/styles/scss/spacing';
|
|
12
|
+
|
|
13
|
+
@use '../../layout';
|
|
14
|
+
|
|
15
|
+
$config: () !default;
|
|
16
|
+
|
|
17
|
+
$-default-config: (
|
|
18
|
+
selector: 'main',
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
/// @group main
|
|
22
|
+
/// @param {Map} config [()]
|
|
23
|
+
/// @param {Selector} config.selector ['main']
|
|
24
|
+
@mixin styles($config: $config) {
|
|
25
|
+
$props: map.deep-merge($-default-config, $config);
|
|
26
|
+
|
|
27
|
+
#{map.get($props, 'selector')} {
|
|
28
|
+
padding-inline: spacing.$spacing-07;
|
|
29
|
+
padding-block-start: spacing.$spacing-07;
|
|
30
|
+
padding-block-end: spacing.$spacing-10;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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
|
+
|
|
10
|
+
@use '@carbon/styles/scss/spacing';
|
|
11
|
+
@use '@carbon/styles/scss/colors';
|
|
12
|
+
@use '@carbon/styles/scss/theme';
|
|
13
|
+
|
|
14
|
+
@use '../../layout';
|
|
15
|
+
|
|
16
|
+
$config: () !default;
|
|
17
|
+
|
|
18
|
+
$-default-config: (
|
|
19
|
+
selector: 'mark',
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
/// @group marked-text
|
|
23
|
+
/// @param {Map} config [()]
|
|
24
|
+
/// @param {Selector} config.selector ['mark']
|
|
25
|
+
@mixin styles($config: $config) {
|
|
26
|
+
$props: map.deep-merge($-default-config, $config);
|
|
27
|
+
|
|
28
|
+
#{map.get($props, 'selector')} {
|
|
29
|
+
padding-inline: spacing.$spacing-01;
|
|
30
|
+
background-color: colors.$yellow-20;
|
|
31
|
+
color: colors.$black;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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
|
+
|
|
10
|
+
@use '@carbon/styles/scss/theme';
|
|
11
|
+
@use '@carbon/styles/scss/spacing';
|
|
12
|
+
@use '@carbon/styles/scss/utilities/box-shadow';
|
|
13
|
+
@use '@carbon/styles/scss/utilities/focus-outline';
|
|
14
|
+
|
|
15
|
+
@use '../../layout';
|
|
16
|
+
@use '../../utilities/icons';
|
|
17
|
+
|
|
18
|
+
$config: () !default;
|
|
19
|
+
|
|
20
|
+
$-default-config: (
|
|
21
|
+
selector: 'ul[role="menu"]',
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
/// @group menu
|
|
25
|
+
/// @param {Map} config [()]
|
|
26
|
+
/// @param {Selector} config.selector ['ul[role="menu"]']
|
|
27
|
+
@mixin styles($config: $config) {
|
|
28
|
+
$props: map.deep-merge($-default-config, $config);
|
|
29
|
+
|
|
30
|
+
#{map.get($props, 'selector')} {
|
|
31
|
+
@include box-shadow.box-shadow;
|
|
32
|
+
background-color: theme.$layer;
|
|
33
|
+
list-style: none;
|
|
34
|
+
margin: 0;
|
|
35
|
+
padding-inline: 0;
|
|
36
|
+
padding-block: spacing.$spacing-02;
|
|
37
|
+
inline-size: 14rem;
|
|
38
|
+
|
|
39
|
+
& li[role="menuitem"],
|
|
40
|
+
& li[role="menuitemcheckbox"],
|
|
41
|
+
& li[role="menuitemradio"] {
|
|
42
|
+
@include layout.mode--body-compact;
|
|
43
|
+
display: flex;
|
|
44
|
+
column-gap: spacing.$spacing-03;
|
|
45
|
+
color: theme.$text-secondary;
|
|
46
|
+
padding-inline: layout.$density--padding;
|
|
47
|
+
block-size: layout.$size--block-size;
|
|
48
|
+
padding-block-start: layout.$size--padding-block-start;
|
|
49
|
+
padding-block-end: layout.$size--padding-block-end;
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
|
|
53
|
+
&:hover {
|
|
54
|
+
background-color: theme.$layer-hover;
|
|
55
|
+
color: theme.$text-primary;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:active {
|
|
59
|
+
background-color: theme.$layer-active;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&:focus {
|
|
63
|
+
@include focus-outline.focus-outline('outline');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:has(li[aria-checked]) {
|
|
68
|
+
& li[role="menuitem"]::before,
|
|
69
|
+
& li[role="menuitemcheckbox"]::before,
|
|
70
|
+
& li[role="menuitemradio"]::before {
|
|
71
|
+
content: '';
|
|
72
|
+
display: block;
|
|
73
|
+
inline-size: 1rem;
|
|
74
|
+
translate: 0 0.0625rem;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
& li[role="menuitemcheckbox"][aria-checked="true"]::before,
|
|
79
|
+
& li[role="menuitemradio"][aria-checked="true"]::before {
|
|
80
|
+
@include icons.checkmark;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
& li > svg {
|
|
84
|
+
fill: currentColor;
|
|
85
|
+
block-size: 1rem;
|
|
86
|
+
inline-size: 1rem;
|
|
87
|
+
translate: 0 0.0625rem;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&:has(li > svg) li:not(:has(> svg)):is([role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]) {
|
|
91
|
+
column-gap: calc(spacing.$spacing-03 + 1rem + spacing.$spacing-03);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
& li[role="separator"] {
|
|
95
|
+
block-size: 0.0625rem;
|
|
96
|
+
background-color: theme.$border-subtle;
|
|
97
|
+
margin-block: spacing.$spacing-02;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
& ul[role="group"] {
|
|
101
|
+
list-style: none;
|
|
102
|
+
margin: 0;
|
|
103
|
+
padding: 0;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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
|
+
|
|
10
|
+
@use '../_labelled-input';
|
|
11
|
+
|
|
12
|
+
$config: () !default;
|
|
13
|
+
|
|
14
|
+
$-default-config: (
|
|
15
|
+
selector: 'label:has(input[type="number"])',
|
|
16
|
+
axis: 'block',
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
/// @group number-input
|
|
20
|
+
/// @param {Map} config [()]
|
|
21
|
+
/// @param {Selector} config.selector ['label:has(input[type="number"])']
|
|
22
|
+
/// @param {'block' | 'axis'} config.axis ['block']
|
|
23
|
+
@mixin styles($config: $config) {
|
|
24
|
+
$props: map.deep-merge($-default-config, $config);
|
|
25
|
+
|
|
26
|
+
#{map.get($props, 'selector')} {
|
|
27
|
+
@include labelled-input.styles((
|
|
28
|
+
label: (
|
|
29
|
+
selector: '&',
|
|
30
|
+
axis: map.get($props, 'axis'),
|
|
31
|
+
),
|
|
32
|
+
input: (
|
|
33
|
+
selector: 'input[type="number"]',
|
|
34
|
+
),
|
|
35
|
+
));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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
|
+
|
|
10
|
+
@use '@carbon/styles/scss/spacing';
|
|
11
|
+
|
|
12
|
+
@use '../../layout';
|
|
13
|
+
|
|
14
|
+
$config: () !default;
|
|
15
|
+
|
|
16
|
+
$-default-config: (
|
|
17
|
+
selector: 'ol',
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
/// @group ordered-list
|
|
21
|
+
/// @param {Map} config [()]
|
|
22
|
+
/// @param {Selector} config.selector ['ol']
|
|
23
|
+
@mixin styles($config: $config) {
|
|
24
|
+
$props: map.deep-merge($-default-config, $config);
|
|
25
|
+
|
|
26
|
+
#{map.get($props, 'selector')} {
|
|
27
|
+
list-style-type: decimal;
|
|
28
|
+
padding: 0;
|
|
29
|
+
margin-inline-start: layout.$density--padding;
|
|
30
|
+
|
|
31
|
+
& li {
|
|
32
|
+
@include layout.mode--body-compact;
|
|
33
|
+
max-inline-size: layout.$mode--max-inline-size;
|
|
34
|
+
margin-inline-start: spacing.$spacing-03;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
& li p {
|
|
38
|
+
@include layout.mode--body-compact;
|
|
39
|
+
margin-block: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
& ol {
|
|
43
|
+
list-style-type: lower-alpha;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
& ol ol {
|
|
47
|
+
list-style-type: lower-roman;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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
|
+
|
|
10
|
+
@use '../../layout';
|
|
11
|
+
|
|
12
|
+
$config: () !default;
|
|
13
|
+
|
|
14
|
+
$-default-config: (
|
|
15
|
+
selector: 'p',
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
/// @group paragraph
|
|
19
|
+
/// @param {Map} config [()]
|
|
20
|
+
/// @param {Selector} config.selector ['p']
|
|
21
|
+
@mixin styles($config: $config) {
|
|
22
|
+
$props: map.deep-merge($-default-config, $config);
|
|
23
|
+
|
|
24
|
+
#{map.get($props, 'selector')} {
|
|
25
|
+
@include layout.mode--body;
|
|
26
|
+
max-inline-size: layout.$mode--max-inline-size;
|
|
27
|
+
margin-block: layout.$mode--margin-block;
|
|
28
|
+
text-wrap: pretty;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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
|
+
|
|
10
|
+
@use '../_labelled-input';
|
|
11
|
+
|
|
12
|
+
$config: () !default;
|
|
13
|
+
|
|
14
|
+
$-default-config: (
|
|
15
|
+
selector: 'label:has(input[type="password"])',
|
|
16
|
+
axis: 'block',
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
/// @group password-input
|
|
20
|
+
/// @param {Map} config [()]
|
|
21
|
+
/// @param {Selector} config.selector ['label:has(input[type="password"])']
|
|
22
|
+
/// @param {'block' | 'axis'} config.axis ['block']
|
|
23
|
+
@mixin styles($config: $config) {
|
|
24
|
+
$props: map.deep-merge($-default-config, $config);
|
|
25
|
+
|
|
26
|
+
#{map.get($props, 'selector')} {
|
|
27
|
+
@include labelled-input.styles((
|
|
28
|
+
label: (
|
|
29
|
+
selector: '&',
|
|
30
|
+
axis: map.get($props, 'axis'),
|
|
31
|
+
),
|
|
32
|
+
input: (
|
|
33
|
+
selector: 'input[type="password"]',
|
|
34
|
+
),
|
|
35
|
+
input-invalid-slot: 'after',
|
|
36
|
+
));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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
|
+
|
|
10
|
+
@use '@carbon/styles/scss/theme';
|
|
11
|
+
@use '@carbon/styles/scss/spacing';
|
|
12
|
+
@use '@carbon/styles/scss/utilities/box-shadow';
|
|
13
|
+
|
|
14
|
+
@use '../_layer';
|
|
15
|
+
|
|
16
|
+
@use '../../layout';
|
|
17
|
+
@use '../../utilities/tokens';
|
|
18
|
+
|
|
19
|
+
$config: () !default;
|
|
20
|
+
|
|
21
|
+
$-default-config: (
|
|
22
|
+
selector: '[popover]',
|
|
23
|
+
caret: true,
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
/// @group popover
|
|
27
|
+
/// @param {Map} config [()]
|
|
28
|
+
/// @param {Selector} config.selector ['[popover]']
|
|
29
|
+
/// @param {Bool} config.caret [true]
|
|
30
|
+
@mixin styles($config: $config) {
|
|
31
|
+
$props: map.deep-merge($-default-config, $config);
|
|
32
|
+
|
|
33
|
+
$-caret-size: 0rem;
|
|
34
|
+
@if map.get($props, 'caret') {
|
|
35
|
+
$-caret-size: 0.75rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
#{map.get($props, 'selector')} {
|
|
39
|
+
@include layer.styles;
|
|
40
|
+
@include box-shadow.box-shadow;
|
|
41
|
+
@include layout.mode--body;
|
|
42
|
+
position: absolute;
|
|
43
|
+
inset: unset;
|
|
44
|
+
margin: 0;
|
|
45
|
+
inset-block-start: calc(anchor(end) + spacing.$spacing-02 + ($-caret-size * 0.5));
|
|
46
|
+
inset-inline-start: calc(anchor(start) + spacing.$spacing-02);
|
|
47
|
+
border: none;
|
|
48
|
+
border-radius: 0.125rem;
|
|
49
|
+
padding: layout.$density--padding;
|
|
50
|
+
overflow: visible;
|
|
51
|
+
|
|
52
|
+
&::before {
|
|
53
|
+
@include box-shadow.box-shadow;
|
|
54
|
+
content: '';
|
|
55
|
+
position: absolute;
|
|
56
|
+
display: block;
|
|
57
|
+
block-size: $-caret-size;
|
|
58
|
+
inline-size: $-caret-size;
|
|
59
|
+
rotate: -45deg;
|
|
60
|
+
background-color: inherit;
|
|
61
|
+
inset-block-start: calc($-caret-size * -0.5);
|
|
62
|
+
inset-inline-start: layout.$density--padding;
|
|
63
|
+
clip-path: polygon(
|
|
64
|
+
0% 0%,
|
|
65
|
+
100% 0%,
|
|
66
|
+
100% 100%,
|
|
67
|
+
0% 0%,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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
|
+
|
|
10
|
+
@use '@carbon/styles/scss/theme';
|
|
11
|
+
|
|
12
|
+
@use '../../layout';
|
|
13
|
+
|
|
14
|
+
$config: () !default;
|
|
15
|
+
|
|
16
|
+
$-default-config: (
|
|
17
|
+
selector: 'pre',
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
/// @group preformatted
|
|
21
|
+
/// @param {Map} config [()]
|
|
22
|
+
/// @param {Selector} config.selector ['pre']
|
|
23
|
+
@mixin styles($config: $config) {
|
|
24
|
+
$props: map.deep-merge($-default-config, $config);
|
|
25
|
+
|
|
26
|
+
#{map.get($props, 'selector')} {
|
|
27
|
+
@include layout.mode--code;
|
|
28
|
+
white-space: pre;
|
|
29
|
+
margin-block: layout.$mode--margin-block;
|
|
30
|
+
padding: layout.$density--padding;
|
|
31
|
+
background-color: theme.$layer;
|
|
32
|
+
inline-size: 100%;
|
|
33
|
+
overflow-x: auto;
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
|
|
36
|
+
& code {
|
|
37
|
+
box-shadow: none;
|
|
38
|
+
border-radius: 0;
|
|
39
|
+
padding-inline: 0;
|
|
40
|
+
background-color: transparent;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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
|
+
|
|
10
|
+
@use '@carbon/styles/scss/config' as carbon-config;
|
|
11
|
+
@use '@carbon/styles/scss/theme';
|
|
12
|
+
@use '@carbon/styles/scss/motion';
|
|
13
|
+
|
|
14
|
+
@use '../label';
|
|
15
|
+
|
|
16
|
+
@use '../../config';
|
|
17
|
+
@use '../../layout';
|
|
18
|
+
|
|
19
|
+
$config: () !default;
|
|
20
|
+
|
|
21
|
+
$-default-config: (
|
|
22
|
+
selector: 'label:has(progress)',
|
|
23
|
+
axis: 'block',
|
|
24
|
+
thickness: 'thick',
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
$-indeterminate-ratio: 0.25;
|
|
28
|
+
|
|
29
|
+
/// @group progress-bar
|
|
30
|
+
/// @param {Map} config [()]
|
|
31
|
+
/// @param {Selector} config.selector ['progress']
|
|
32
|
+
/// @param {'block' | 'axis'} config.axis ['block']
|
|
33
|
+
/// @param {'thick' | 'thin'} config.thickness ['thick']
|
|
34
|
+
@mixin styles($config: $config) {
|
|
35
|
+
$props: map.deep-merge($-default-config, $config);
|
|
36
|
+
|
|
37
|
+
#{map.get($props, 'selector')} {
|
|
38
|
+
@include label.styles((
|
|
39
|
+
selector: '&',
|
|
40
|
+
axis: map.get($props, 'axis'),
|
|
41
|
+
));
|
|
42
|
+
|
|
43
|
+
& progress {
|
|
44
|
+
appearance: none;
|
|
45
|
+
|
|
46
|
+
@if map.get($props, 'thickness') == 'thick' {
|
|
47
|
+
block-size: 0.5rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@if map.get($props, 'thickness') == 'thin' {
|
|
51
|
+
block-size: 0.25rem;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
& progress::-webkit-progress-bar {
|
|
56
|
+
background-color: theme.$layer;
|
|
57
|
+
block-size: inherit;
|
|
58
|
+
border: none;
|
|
59
|
+
box-shadow: none;
|
|
60
|
+
border-radius: 0;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
& progress::-webkit-progress-value {
|
|
65
|
+
background-color: theme.$interactive;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
& progress:not([value])::-webkit-progress-value {
|
|
69
|
+
inline-size: calc(100% * $-indeterminate-ratio);
|
|
70
|
+
animation-name: #{carbon-config.$prefix}--#{config.$prefix}--progress-bar--indeterminate;
|
|
71
|
+
animation-duration: calc(motion.$duration-slow-02 * 2);
|
|
72
|
+
animation-timing-function: linear;
|
|
73
|
+
animation-iteration-count: infinite;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@keyframes #{carbon-config.$prefix}--#{config.$prefix}--progress-bar--indeterminate {
|
|
77
|
+
0% {
|
|
78
|
+
translate: -100% 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
100% {
|
|
82
|
+
translate: calc(100% / $-indeterminate-ratio) 0;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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
|
+
|
|
10
|
+
@use '@carbon/styles/scss/theme';
|
|
11
|
+
@use '@carbon/styles/scss/utilities/focus-outline';
|
|
12
|
+
|
|
13
|
+
@use '../label';
|
|
14
|
+
|
|
15
|
+
@use '../../layout';
|
|
16
|
+
|
|
17
|
+
$config: () !default;
|
|
18
|
+
|
|
19
|
+
$-default-config: (
|
|
20
|
+
selector: 'label:has(input[type="radio"])',
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
/// @group radio-button
|
|
24
|
+
/// @param {Map} config [()]
|
|
25
|
+
/// @param {Selector} config.selector [''label:has(input[type="radio"])'']
|
|
26
|
+
@mixin styles($config: $config) {
|
|
27
|
+
$props: map.deep-merge($-default-config, $config);
|
|
28
|
+
|
|
29
|
+
#{map.get($props, 'selector')} {
|
|
30
|
+
@include label.styles((
|
|
31
|
+
selector: '&',
|
|
32
|
+
axis: 'inline',
|
|
33
|
+
));
|
|
34
|
+
|
|
35
|
+
justify-content: start;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
|
|
38
|
+
& input[type="radio"] {
|
|
39
|
+
grid-column: 1;
|
|
40
|
+
position: relative;
|
|
41
|
+
appearance: none;
|
|
42
|
+
border: none;
|
|
43
|
+
block-size: 1rem;
|
|
44
|
+
inline-size: 1rem;
|
|
45
|
+
border-radius: 50%;
|
|
46
|
+
color: theme.$icon-primary;
|
|
47
|
+
border: 0.0625rem solid currentColor;
|
|
48
|
+
|
|
49
|
+
&:focus {
|
|
50
|
+
@include focus-outline.focus-outline('outline');
|
|
51
|
+
outline-offset: 0.125rem;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:disabled {
|
|
55
|
+
color: theme.$icon-disabled;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:checked::before {
|
|
59
|
+
content: '';
|
|
60
|
+
position: absolute;
|
|
61
|
+
inset: 0.25rem;
|
|
62
|
+
border-radius: 50%;
|
|
63
|
+
background-color: currentColor;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|