opencode_offline/packages/ui/src/components/select.css

149 lines
3.1 KiB
CSS
Raw Normal View History

2025-10-14 20:14:26 +08:00
[data-component="select"] {
[data-slot="select-select-trigger"] {
2025-10-18 01:05:52 +08:00
padding: 0 4px 0 8px;
2025-10-23 06:31:44 +08:00
box-shadow: none;
2025-10-18 01:05:52 +08:00
[data-slot="select-select-trigger-value"] {
2025-10-17 03:53:44 +08:00
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
[data-slot="select-select-trigger-icon"] {
2025-10-23 06:31:44 +08:00
width: 16px;
height: 16px;
2025-10-17 03:53:44 +08:00
flex-shrink: 0;
color: var(--text-weak);
transition: transform 0.1s ease-in-out;
}
2025-12-17 01:34:41 +08:00
&[data-expanded] {
&[data-variant="secondary"] {
background-color: var(--button-secondary-hover);
}
&[data-variant="ghost"] {
background-color: var(--surface-raised-base-active);
}
&[data-variant="primary"] {
background-color: var(--icon-strong-active);
}
}
&:not([data-expanded]):focus {
&[data-variant="secondary"] {
background-color: var(--button-secondary-base);
}
&[data-variant="ghost"] {
background-color: transparent;
}
&[data-variant="primary"] {
background-color: var(--icon-strong-base);
}
}
2025-10-14 20:14:26 +08:00
}
2025-10-17 03:53:44 +08:00
}
2025-10-14 20:14:26 +08:00
2025-10-17 03:53:44 +08:00
[data-component="select-content"] {
2025-10-23 06:31:44 +08:00
min-width: 4rem;
max-width: 23rem;
2025-10-17 03:53:44 +08:00
overflow: hidden;
2025-11-14 04:47:25 +08:00
border-radius: var(--radius-md);
2025-10-23 06:31:44 +08:00
background-color: var(--surface-raised-stronger-non-alpha);
padding: 2px;
box-shadow: var(--shadow-xs-border);
2025-10-17 03:53:44 +08:00
z-index: 50;
&[data-closed] {
animation: select-close 0.15s ease-out;
}
&[data-expanded] {
animation: select-open 0.15s ease-out;
}
[data-slot="select-select-content-list"] {
2025-10-17 03:53:44 +08:00
overflow-y: auto;
max-height: 12rem;
white-space: nowrap;
overflow-x: hidden;
2025-10-23 06:31:44 +08:00
display: flex;
flex-direction: column;
2025-10-17 03:53:44 +08:00
&:focus {
outline: none;
}
> *:not([role="presentation"]) + *:not([role="presentation"]) {
margin-top: 2px;
}
2025-10-14 20:14:26 +08:00
}
/* [data-slot="select-section"] { */
2025-10-23 06:31:44 +08:00
/* } */
2025-10-14 20:14:26 +08:00
[data-slot="select-select-item"] {
2025-10-14 20:14:26 +08:00
position: relative;
display: flex;
align-items: center;
2025-10-23 06:31:44 +08:00
padding: 0 6px 0 6px;
gap: 12px;
2025-11-14 04:47:25 +08:00
border-radius: var(--radius-sm);
2025-10-23 06:31:44 +08:00
/* text-12-medium */
font-family: var(--font-family-sans);
font-size: var(--font-size-small);
font-style: normal;
font-weight: var(--font-weight-medium);
line-height: var(--line-height-large); /* 166.667% */
letter-spacing: var(--letter-spacing-normal);
color: var(--text-strong);
2025-10-15 01:06:13 +08:00
transition:
background-color 0.2s ease-in-out,
color 0.2s ease-in-out;
outline: none;
2025-10-14 20:14:26 +08:00
user-select: none;
&[data-highlighted] {
2025-10-23 06:31:44 +08:00
background: var(--surface-raised-base-hover);
2025-10-14 20:14:26 +08:00
}
&[data-disabled] {
2025-10-23 06:31:44 +08:00
background-color: var(--surface-raised-base);
2025-10-14 20:14:26 +08:00
pointer-events: none;
}
[data-slot="select-select-item-indicator"] {
2025-10-14 20:14:26 +08:00
margin-left: auto;
2025-10-23 06:51:09 +08:00
width: 16px;
height: 16px;
2025-10-14 20:14:26 +08:00
}
2025-10-17 03:53:44 +08:00
&:focus {
outline: none;
2025-10-14 20:14:26 +08:00
}
2025-10-17 03:53:44 +08:00
&:hover {
2025-10-23 06:31:44 +08:00
background: var(--surface-raised-base-hover);
2025-10-17 03:53:44 +08:00
}
2025-10-14 20:14:26 +08:00
}
}
2025-10-15 01:06:13 +08:00
@keyframes select-open {
from {
opacity: 0;
transform: scale(0.95);
}
to {
opacity: 1;
transform: scale(1);
}
}
@keyframes select-close {
from {
opacity: 1;
transform: scale(1);
}
to {
opacity: 0;
transform: scale(0.95);
}
}