select.css 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. [data-component="select"] {
  2. [data-slot="select-select-trigger"] {
  3. padding: 0 4px 0 8px;
  4. box-shadow: none;
  5. [data-slot="select-select-trigger-value"] {
  6. overflow: hidden;
  7. text-overflow: ellipsis;
  8. white-space: nowrap;
  9. }
  10. [data-slot="select-select-trigger-icon"] {
  11. width: 16px;
  12. height: 16px;
  13. flex-shrink: 0;
  14. color: var(--text-weak);
  15. transition: transform 0.1s ease-in-out;
  16. }
  17. }
  18. }
  19. [data-component="select-content"] {
  20. min-width: 4rem;
  21. max-width: 23rem;
  22. overflow: hidden;
  23. border-radius: var(--radius-md);
  24. border-width: 1px;
  25. border-style: solid;
  26. border-color: var(--border-weak-base);
  27. background-color: var(--surface-raised-stronger-non-alpha);
  28. padding: 2px;
  29. box-shadow: var(--shadow-xs);
  30. z-index: 50;
  31. &[data-closed] {
  32. animation: select-close 0.15s ease-out;
  33. }
  34. &[data-expanded] {
  35. animation: select-open 0.15s ease-out;
  36. }
  37. [data-slot="select-select-content-list"] {
  38. min-height: 2rem;
  39. overflow-y: auto;
  40. max-height: 12rem;
  41. white-space: nowrap;
  42. overflow-x: hidden;
  43. display: flex;
  44. flex-direction: column;
  45. gap: 2px;
  46. &:focus {
  47. outline: none;
  48. }
  49. }
  50. /* [data-slot="select-section"] { */
  51. /* } */
  52. [data-slot="select-select-item"] {
  53. position: relative;
  54. display: flex;
  55. align-items: center;
  56. padding: 0 6px 0 6px;
  57. border-radius: var(--radius-sm);
  58. /* text-12-medium */
  59. font-family: var(--font-family-sans);
  60. font-size: var(--font-size-small);
  61. font-style: normal;
  62. font-weight: var(--font-weight-medium);
  63. line-height: var(--line-height-large); /* 166.667% */
  64. letter-spacing: var(--letter-spacing-normal);
  65. color: var(--text-strong);
  66. transition:
  67. background-color 0.2s ease-in-out,
  68. color 0.2s ease-in-out;
  69. outline: none;
  70. user-select: none;
  71. &[data-highlighted] {
  72. background: var(--surface-raised-base-hover);
  73. }
  74. &[data-disabled] {
  75. background-color: var(--surface-raised-base);
  76. pointer-events: none;
  77. }
  78. [data-slot="select-select-item-indicator"] {
  79. margin-left: auto;
  80. width: 16px;
  81. height: 16px;
  82. }
  83. &:focus {
  84. outline: none;
  85. }
  86. &:hover {
  87. background: var(--surface-raised-base-hover);
  88. }
  89. }
  90. }
  91. @keyframes select-open {
  92. from {
  93. opacity: 0;
  94. transform: scale(0.95);
  95. }
  96. to {
  97. opacity: 1;
  98. transform: scale(1);
  99. }
  100. }
  101. @keyframes select-close {
  102. from {
  103. opacity: 1;
  104. transform: scale(1);
  105. }
  106. to {
  107. opacity: 0;
  108. transform: scale(0.95);
  109. }
  110. }