Spaces:
Runtime error
Runtime error
File size: 2,359 Bytes
46252cd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | .custom-select {
position: relative;
display: flex;
min-width: 0;
}
.custom-select-trigger {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
width: 100%;
padding: 0.75rem 0;
border: none;
background: transparent;
color: var(--text-primary);
font-size: 0.9375rem;
font-family: inherit;
cursor: pointer;
white-space: nowrap;
overflow: hidden;
}
.custom-select-trigger:hover {
color: var(--text-primary);
}
.custom-select-trigger:focus-visible {
outline: 2px solid var(--primary);
outline-offset: 2px;
}
.custom-select-label {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
text-align: left;
}
.custom-select-chevron {
flex-shrink: 0;
color: var(--text-muted);
transition: transform 0.2s ease;
}
.custom-select-chevron.open {
transform: rotate(180deg);
}
.custom-select-dropdown {
position: absolute;
top: calc(100% + 4px);
left: 0;
right: 0;
min-width: 160px;
max-height: min(250px, 40vh);
overflow-y: auto;
background: var(--bg-white);
border: 1px solid var(--border);
border-radius: var(--radius);
box-shadow: var(--shadow-lg);
z-index: 200;
padding: 0.3rem;
animation: customSelectFadeIn 0.15s ease;
}
@keyframes customSelectFadeIn {
from {
opacity: 0;
transform: translateY(-4px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.custom-select-option {
display: flex;
align-items: center;
width: 100%;
min-height: 34px;
padding: 0.45rem 0.6rem;
color: var(--text-secondary);
background: transparent;
border: 0;
border-radius: calc(var(--radius) - 2px);
font-size: 0.875rem;
font-weight: 500;
font-family: inherit;
text-align: left;
cursor: pointer;
transition: all 0.15s;
}
.custom-select-option:hover,
.custom-select-option.focused {
background: var(--bg-light);
color: var(--text-primary);
}
.custom-select-option.selected {
background: var(--primary-soft);
color: var(--primary);
font-weight: 600;
}
/* RTL support */
[dir='rtl'] .custom-select-label {
text-align: right;
}
[dir='rtl'] .custom-select-option {
text-align: right;
}
/* Mobile responsive */
@media (max-width: 768px) {
.custom-select-trigger {
padding: 0.625rem 0;
font-size: 0.875rem;
}
.custom-select-dropdown {
max-height: min(220px, 40vh);
}
}
|