Skip to content

Commit d91dd77

Browse files
fix(multi-select): adjust AI label spacing when clear button appears (#19450)
* fix(multi-select): adjust AI label spacing when clear button appears * Use spacing token for block-size Co-authored-by: Anna Wen <[email protected]> --------- Co-authored-by: Anna Wen <[email protected]>
1 parent 781e9d0 commit d91dd77

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

packages/web-components/src/components/multi-select/multi-select.scss

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ $css--plex: true !default;
1616
@use '@carbon/styles/scss/components/form';
1717
@use '@carbon/styles/scss/components/checkbox';
1818
@use '@carbon/styles/scss/components/tag';
19+
@use '@carbon/styles/scss/utilities/convert';
1920

2021
:host(#{$prefix}-multi-select) {
2122
outline: none;
@@ -59,6 +60,12 @@ $css--plex: true !default;
5960
outline-offset: -#{$spacing-01};
6061
}
6162

63+
:host(#{$prefix}-multi-select[filterable])
64+
.#{$prefix}--list-box__field:has(.#{$prefix}--list-box__selection)
65+
~ ::slotted(#{$prefix}-ai-label) {
66+
inset-inline-end: calc($spacing-10 + 18px);
67+
}
68+
6269
:host(#{$prefix}-multi-select[direction='top']) {
6370
@extend .#{$prefix}--list-box--up;
6471

@@ -169,7 +176,8 @@ $css--plex: true !default;
169176
::slotted(#{$prefix}-slug) {
170177
position: absolute;
171178
inset-block-start: 50%;
172-
inset-inline-end: $spacing-08;
179+
inset-inline-end: calc($spacing-08 + 9px);
180+
margin-block-start: convert.to-rem(0.5px);
173181
}
174182

175183
::slotted(#{$prefix}-ai-label:not([revert-active])),
@@ -178,6 +186,17 @@ $css--plex: true !default;
178186
}
179187
}
180188

189+
:host(#{$prefix}-multi-select[ai-label]) ::slotted(#{$prefix}-ai-label)::after {
190+
position: absolute;
191+
display: block;
192+
background-color: $border-subtle-01;
193+
block-size: $spacing-05;
194+
content: '';
195+
inline-size: convert.to-rem(1px);
196+
inset-block-start: 0;
197+
inset-inline-end: convert.to-rem(-9px);
198+
}
199+
181200
:host(#{$prefix}-multi-select[ai-label][warn]),
182201
:host(#{$prefix}-multi-select[ai-label][invalid]) {
183202
.#{$prefix}--list-box {

0 commit comments

Comments
 (0)