Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added dividers accross multiple states for AI select #15952

48 changes: 40 additions & 8 deletions packages/styles/scss/components/select/_select.scss
Expand Up @@ -281,30 +281,62 @@
}

// Slug styles

$divider-width: 1px;

.#{$prefix}--select--slug .#{$prefix}--slug {
position: absolute;
inset-block-start: 50%;
inset-inline-end: $spacing-08;
inset-inline-end: calc($spacing-08 + 8px + $divider-width);
margin-block-start: convert.to-rem(0.5px);
transform: translateY(-50%);
}

.#{$prefix}--select--slug .#{$prefix}--slug::after,
.#{$prefix}--select--slug .#{$prefix}--slug::before {
position: absolute;
background-color: $border-subtle-01;
block-size: convert.to-rem(16px);
content: '';
inline-size: convert.to-rem(1px);
}

.#{$prefix}--select--slug .#{$prefix}--slug::before {
display: none;
inset-inline-start: calc(-#{$spacing-03} - #{$divider-width});
}

.#{$prefix}--select--slug .#{$prefix}--slug::after {
display: block;
inset-inline-end: calc(-#{$spacing-03} - #{$divider-width});
}

.#{$prefix}--select--slug
.#{$prefix}--select-input:not(:has(~ .#{$prefix}--slug--revert)) {
@include ai-gradient;

padding-inline-end: $spacing-10;
}

.#{$prefix}--select--slug.#{$prefix}--select--invalid
.#{$prefix}--select-input,
.#{$prefix}--select--slug.#{$prefix}--select--warning
.#{$prefix}--select-input {
.#{$prefix}--select--slug:has(.#{$prefix}--select__invalid-icon)
.#{$prefix}--select-input:not(:has(~ .#{$prefix}--slug--revert)) {
padding-inline-end: $spacing-12;
}

.#{$prefix}--select--slug.#{$prefix}--select--invalid .#{$prefix}--slug,
.#{$prefix}--select--slug.#{$prefix}--select--warning .#{$prefix}--slug {
inset-inline-end: $spacing-10;
.#{$prefix}--select--slug:has(.#{$prefix}--select__invalid-icon)
.#{$prefix}--slug::before {
display: block;
}

.#{$prefix}--select--slug
.#{$prefix}--select-input__wrapper[data-invalid]
.#{$prefix}--select-input
~ .#{$prefix}--select__invalid-icon,
.#{$prefix}--select--slug
.#{$prefix}--select-input__wrapper
.#{$prefix}--select-input
~ .#{$prefix}--select__invalid-icon {
inset-inline-end: $spacing-11;
}

// Windows HCM fix
Expand Down