125 lines
2.3 KiB
CSS
125 lines
2.3 KiB
CSS
/* ChoiceSelect.css */
|
|
.choice-select {
|
|
position: relative;
|
|
display: flex;
|
|
|
|
color: var(--accent-brand);
|
|
}
|
|
|
|
.choice-select[data-disabled] {
|
|
opacity: 0.5;
|
|
}
|
|
|
|
.choice-select__trigger {
|
|
flex: 1 1 auto;
|
|
width: 100%;
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
|
|
padding: 0;
|
|
padding-inline: 5%;
|
|
|
|
background: transparent;
|
|
border: var(--border-width) solid var(--border-hairline);
|
|
border-radius: var(--radius-sm);
|
|
|
|
font-family: var(--font-ui);
|
|
font-size: 90%;
|
|
|
|
color: inherit;
|
|
|
|
cursor: pointer;
|
|
transition: border-color var(--dur-base) var(--ease-standard);
|
|
}
|
|
|
|
.choice-select__trigger:hover,
|
|
.choice-select__trigger--open {
|
|
border-color: var(--accent-brand);
|
|
}
|
|
|
|
.choice-select__trigger:disabled {
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.choice-select__label {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.choice-select__chevron {
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
|
|
width: 4cqh;
|
|
aspect-ratio: 1;
|
|
|
|
color: var(--accent-brand);
|
|
transition: transform var(--dur-base) var(--ease-standard);
|
|
}
|
|
|
|
.choice-select__trigger--open .choice-select__chevron {
|
|
transform: rotate(180deg);
|
|
}
|
|
|
|
.choice-select__chevron svg {
|
|
width: 50%;
|
|
height: auto;
|
|
display: block;
|
|
}
|
|
|
|
.choice-select__option {
|
|
padding: 1%;
|
|
border-radius: var(--radius-sm);
|
|
font-size: 100%;
|
|
color: var(--text-primary);
|
|
cursor: pointer;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.choice-select__option--highlight {
|
|
background: var(--bg-raised);
|
|
}
|
|
|
|
.choice-select__option--selected {
|
|
color: var(--accent-brand);
|
|
font-weight: var(--font-weight-semibold);
|
|
}
|
|
|
|
.choice-select__listbox {
|
|
position: absolute;
|
|
left: 0;
|
|
right: 0;
|
|
z-index: 40;
|
|
|
|
top: calc(100% + var(--space-1));
|
|
|
|
margin: 0;
|
|
padding: var(--space-1);
|
|
list-style: none;
|
|
|
|
background: var(--bg-panel);
|
|
border: var(--border-width) solid var(--border-hairline);
|
|
border-radius: var(--radius-sm);
|
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
|
|
|
|
max-height: 240px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.choice-select__listbox--up {
|
|
top: auto;
|
|
bottom: calc(100% + var(--space-1));
|
|
}
|
|
|
|
.choice-select__listbox--portal {
|
|
position: fixed;
|
|
z-index: 1000; /* clear of any local stacking contexts in the panel */
|
|
} |