Files
web/packages/design-system/lib/components/Select/select.module.css
2025-04-11 09:24:45 +02:00

135 lines
2.3 KiB
CSS

.select {
position: relative;
background-color: var(--Surface-UI-Fill-Default);
border: 1px solid var(--Border-Interactive-Default);
border-radius: var(--Corner-radius-md);
&[data-required] .label::after {
content: ' *';
}
&[data-open] .chevron {
rotate: -90deg;
}
&[data-focused] {
border-color: var(--Border-Interactive-Focus);
.button,
.input {
outline: none;
}
.input {
position: unset;
}
.label {
color: var(--Text-Interactive-Focus);
}
}
&[data-disabled] {
.inner {
background-color: var(--Surface-Primary-Disabled);
color: var(--Text-Interactive-Disabled);
}
.button,
.input,
.label,
.selectValue {
color: var(--Text-Interactive-Disabled);
}
}
&[data-invalid] {
border-color: var(--Border-Interactive-Error);
}
}
.chevron {
rotate: 90deg;
}
.inner {
display: flex;
align-items: center;
gap: var(--Space-x1);
width: 100%;
height: 56px;
padding: var(--Space-x15);
box-sizing: border-box;
.button {
padding: 0;
}
}
.button,
.input {
background: none;
border: 0;
}
.input {
position: absolute;
padding: 0;
&[value]:not([value='']) {
position: unset;
}
}
.displayText {
display: flex;
flex-direction: column;
gap: calc(var(--Space-x05) / 2);
flex: 1;
justify-content: center;
height: 100%;
&:has(.input) {
cursor: text;
}
}
.selectValue {
align-items: flex-start;
color: var(--Text-Default);
}
.label {
color: var(--Text-Interactive-Placeholder);
}
.popover {
background-color: var(--Surface-Primary-Default);
border-radius: var(--Corner-radius-md);
box-shadow: 0 0 14px 6px rgb(0 0 0 / 10%);
display: inline-flex;
flex-direction: column;
gap: var(--Space-x1);
overflow: auto;
padding: var(--Space-x2);
outline: none;
min-width: 280px;
}
.listBox {
display: flex;
flex-direction: column;
gap: var(--Space-x1);
outline: none;
}
.listBoxItem {
padding: var(--Space-x1) var(--Space-x1) var(--Space-x1) var(--Space-x15);
color: var(--Text-Default);
border-radius: var(--Corner-radius-md);
display: flex;
align-items: center;
gap: var(--Space-x1);
&[data-focused] {
outline: none;
}
&[data-focused],
&[data-hovered] {
background-color: var(--Surface-Primary-Hover);
}
}