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

123 lines
2.4 KiB
CSS
Raw Normal View History

2025-10-14 20:14:26 +08:00
[data-component="select"] {
[data-slot="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-trigger-value"] {
2025-10-17 03:53:44 +08:00
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
[data-slot="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-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;
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-17 03:53:44 +08:00
border-width: 1px;
border-style: solid;
border-color: var(--border-weak-base);
2025-10-23 06:31:44 +08:00
background-color: var(--surface-raised-stronger-non-alpha);
padding: 2px;
box-shadow: var(--shadow-xs);
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-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;
gap: 2px;
2025-10-17 03:53:44 +08:00
&:focus {
outline: none;
}
2025-10-14 20:14:26 +08:00
}
2025-10-23 06:31:44 +08:00
/* [data-slot="section"] { */
/* } */
2025-10-14 20:14:26 +08:00
[data-slot="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;
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-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);
}
}