select.css 2.5 KB

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