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

139 lines
3.0 KiB
CSS
Raw Normal View History

2025-10-14 20:14:26 +08:00
[data-component="select"] {
[data-slot="select-select-trigger"] {
padding: 6px 6px 6px 12px;
2025-10-23 06:31:44 +08:00
box-shadow: none;
border-radius: 6px;
min-width: 160px;
height: 32px;
justify-content: flex-end;
gap: 12px;
background-color: transparent;
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;
font-size: var(--font-size-base);
2025-10-17 03:53:44 +08:00
}
[data-slot="select-select-trigger-icon"] {
2025-10-23 06:31:44 +08:00
width: 16px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
2025-10-17 03:53:44 +08:00
flex-shrink: 0;
color: var(--text-weak);
background-color: var(--surface-raised-base);
border-radius: 4px;
2025-10-17 03:53:44 +08:00
transition: transform 0.1s ease-in-out;
}
2025-12-17 01:34:41 +08:00
&:hover {
background-color: var(--input-base);
box-shadow: var(--shadow-xs-border-base);
}
2025-12-17 01:34:41 +08:00
&[data-expanded] {
background-color: var(--input-base);
box-shadow: var(--shadow-xs-border-base);
2025-12-17 01:34:41 +08:00
}
&:not([data-expanded]):focus {
background-color: transparent;
box-shadow: none;
}
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"] {
min-width: 160px;
max-width: 23rem;
2025-10-17 03:53:44 +08:00
overflow: hidden;
border-radius: 8px;
2025-10-23 06:31:44 +08:00
background-color: var(--surface-raised-stronger-non-alpha);
padding: 0;
box-shadow: var(--shadow-xs-border);
2026-01-19 19:03:23 +08:00
z-index: 60;
2025-10-17 03:53:44 +08:00
&[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;
padding: 4px;
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-select-item"] {
2025-10-14 20:14:26 +08:00
position: relative;
display: flex;
align-items: center;
padding: 2px 8px;
gap: 12px;
border-radius: 4px;
cursor: default;
2025-10-23 06:31:44 +08:00
/* text-14-regular */
2025-10-23 06:31:44 +08:00
font-family: var(--font-family-sans);
font-size: var(--font-size-base);
2025-10-23 06:31:44 +08:00
font-style: normal;
font-weight: var(--font-weight-regular);
line-height: var(--line-height-large);
2025-10-23 06:31:44 +08:00
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"] {
display: flex;
align-items: center;
justify-content: center;
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);
}
}