sendou.ink/app/components/elements/Select.module.css
2025-12-26 20:26:22 +01:00

174 lines
3.0 KiB
CSS

.button {
height: var(--input-height);
padding: 0 var(--input-padding-inline);
border: 2px solid var(--color-border);
border-radius: var(--rounded-sm);
background-color: var(--color-bg);
outline: none;
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--s-1-5);
width: 100%;
cursor: pointer;
&[data-focus-visible],
&[aria-expanded="true"] {
outline: var(--input-focus-ring);
outline-offset: 1px;
}
&[data-disabled] {
pointer-events: none;
cursor: not-allowed;
opacity: 0.5;
outline: none;
}
}
.selectValue[data-placeholder] {
color: var(--color-text-high);
}
.icon {
min-width: 18px;
max-width: 18px;
stroke-width: 2.5px;
color: var(--color-text-high);
}
.smallIcon {
min-width: 16px;
max-width: 16px;
stroke-width: 2px;
color: var(--color-text-high);
}
.popover {
padding: var(--s-1);
width: var(--trigger-width);
border: 2px solid var(--color-border);
border-radius: var(--rounded);
background-color: var(--color-bg);
outline: none;
display: flex;
flex-direction: column;
}
.listBox {
overflow: auto;
flex: 1;
}
.item {
font-size: var(--fonts-xsm);
font-weight: var(--semi-bold);
padding: var(--s-1-5);
border-radius: var(--rounded-sm);
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.item[data-disabled] {
color: var(--color-text-high);
}
.itemFocused {
background-color: var(--color-bg-high);
color: var(--color-text);
}
.itemSelected {
color: var(--color-text-accent);
font-weight: var(--bold);
}
.searchField {
display: flex;
gap: var(--s-2);
border-bottom: 2px solid var(--color-border);
border-radius: var(--rounded-sm) var(--rounded-sm) 0 0;
accent-color: var(--color-accent);
background-color: var(--color-bg);
color: var(--color-text);
outline: none;
padding: var(--s-2) var(--s-1-5) calc(var(--s-1) + var(--s-2)) var(--s-1-5);
margin-block-end: var(--s-1-5);
}
.searchInput {
all: unset;
font-size: var(--fonts-xxs);
font-weight: var(--semi-bold);
letter-spacing: 0.5px;
flex: 1;
}
.searchInput::-webkit-search-cancel-button {
display: none;
}
.searchInput::placeholder {
color: var(--color-text-high);
}
.searchClearButton {
background-color: transparent;
border: none;
}
[data-empty] .searchClearButton {
visibility: hidden;
}
.noResults {
font-size: var(--fonts-md);
font-weight: var(--bold);
text-align: center;
padding-block: var(--s-8);
color: var(--color-text-high);
}
.select {
width: 100%;
position: relative;
}
.clearButton {
position: absolute;
bottom: -17px;
right: 9px;
}
.categoryHeading {
display: flex;
align-items: center;
gap: var(--s-2);
font-weight: bold;
color: var(--color-text-high);
text-transform: uppercase;
font-size: var(--fonts-xxs);
padding-block-start: var(--s-2-5);
padding-block-end: var(--s-1);
padding-inline: var(--s-1-5);
white-space: nowrap;
}
.categoryDivider {
background-color: var(--color-border);
width: 100%;
height: 2px;
margin-block: var(--s-2);
}
.categoryHeading img {
border-radius: 100%;
background-color: var(--color-bg-higher);
padding: var(--s-1);
min-width: 28px;
}