list.css 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. @property --bottom-fade {
  2. syntax: "<length>";
  3. inherits: false;
  4. initial-value: 0px;
  5. }
  6. @keyframes scroll {
  7. 0% {
  8. --bottom-fade: 20px;
  9. }
  10. 90% {
  11. --bottom-fade: 20px;
  12. }
  13. 100% {
  14. --bottom-fade: 0;
  15. }
  16. }
  17. [data-component="list"] {
  18. display: flex;
  19. flex-direction: column;
  20. gap: 12px;
  21. overflow: hidden;
  22. padding: 0 12px;
  23. [data-slot="list-search"] {
  24. display: flex;
  25. flex-shrink: 0;
  26. padding: 8px;
  27. align-items: center;
  28. gap: 12px;
  29. align-self: stretch;
  30. margin-bottom: 4px;
  31. border-radius: var(--radius-md);
  32. background: var(--surface-base);
  33. [data-slot="list-search-container"] {
  34. display: flex;
  35. align-items: center;
  36. gap: 8px;
  37. flex: 1 0 0;
  38. max-height: 20px;
  39. [data-slot="list-search-input"] {
  40. width: 100%;
  41. &[data-slot="input-input"] {
  42. line-height: 20px;
  43. max-height: 20px;
  44. }
  45. }
  46. }
  47. > [data-component="icon-button"] {
  48. width: 20px;
  49. height: 20px;
  50. background-color: transparent;
  51. &:hover:not(:disabled),
  52. &:focus:not(:disabled),
  53. &:active:not(:disabled) {
  54. background-color: transparent;
  55. }
  56. &:hover:not(:disabled) [data-slot="icon-svg"] {
  57. color: var(--icon-hover);
  58. }
  59. &:active:not(:disabled) [data-slot="icon-svg"] {
  60. color: var(--icon-active);
  61. }
  62. }
  63. }
  64. [data-slot="list-scroll"] {
  65. display: flex;
  66. flex-direction: column;
  67. gap: 12px;
  68. overflow-y: auto;
  69. overscroll-behavior: contain;
  70. mask: linear-gradient(to bottom, #ffff calc(100% - var(--bottom-fade)), #0000);
  71. animation: scroll;
  72. animation-timeline: --scroll;
  73. scroll-timeline: --scroll y;
  74. scrollbar-width: none;
  75. -ms-overflow-style: none;
  76. &::-webkit-scrollbar {
  77. display: none;
  78. }
  79. [data-slot="list-empty-state"] {
  80. display: flex;
  81. padding: 32px 0px;
  82. flex-direction: column;
  83. justify-content: center;
  84. align-items: center;
  85. gap: 8px;
  86. align-self: stretch;
  87. [data-slot="list-message"] {
  88. display: flex;
  89. justify-content: center;
  90. align-items: center;
  91. gap: 2px;
  92. color: var(--text-weak);
  93. text-align: center;
  94. /* text-14-regular */
  95. font-family: var(--font-family-sans);
  96. font-size: 14px;
  97. font-style: normal;
  98. font-weight: var(--font-weight-regular);
  99. line-height: var(--line-height-large); /* 142.857% */
  100. letter-spacing: var(--letter-spacing-normal);
  101. }
  102. [data-slot="list-filter"] {
  103. color: var(--text-strong);
  104. }
  105. }
  106. [data-slot="list-group"] {
  107. position: relative;
  108. display: flex;
  109. flex-direction: column;
  110. [data-slot="list-header"] {
  111. display: flex;
  112. z-index: 10;
  113. padding: 0 12px 8px 8px;
  114. justify-content: space-between;
  115. align-items: center;
  116. align-self: stretch;
  117. background: var(--surface-raised-stronger-non-alpha);
  118. position: sticky;
  119. top: 0;
  120. color: var(--text-base);
  121. /* text-14-medium */
  122. font-family: var(--font-family-sans);
  123. font-size: 14px;
  124. font-style: normal;
  125. font-weight: var(--font-weight-medium);
  126. line-height: var(--line-height-large); /* 142.857% */
  127. letter-spacing: var(--letter-spacing-normal);
  128. &::after {
  129. content: "";
  130. position: absolute;
  131. top: 100%;
  132. left: 0;
  133. right: 0;
  134. height: 16px;
  135. background: linear-gradient(to bottom, var(--surface-raised-stronger-non-alpha), transparent);
  136. pointer-events: none;
  137. opacity: 0;
  138. transition: opacity 0.15s ease;
  139. }
  140. &[data-stuck="true"]::after {
  141. opacity: 1;
  142. }
  143. }
  144. [data-slot="list-items"] {
  145. display: flex;
  146. flex-direction: column;
  147. align-items: flex-start;
  148. align-self: stretch;
  149. [data-slot="list-item"] {
  150. display: flex;
  151. width: 100%;
  152. padding: 6px 8px 6px 8px;
  153. align-items: center;
  154. color: var(--text-strong);
  155. scroll-margin-top: 28px;
  156. /* text-14-medium */
  157. font-family: var(--font-family-sans);
  158. font-size: 14px;
  159. font-style: normal;
  160. font-weight: var(--font-weight-medium);
  161. line-height: var(--line-height-large); /* 142.857% */
  162. letter-spacing: var(--letter-spacing-normal);
  163. [data-slot="list-item-selected-icon"] {
  164. display: inline-flex;
  165. align-items: center;
  166. justify-content: center;
  167. flex-shrink: 0;
  168. aspect-ratio: 1/1;
  169. [data-component="icon"] {
  170. color: var(--icon-strong-base);
  171. }
  172. }
  173. [data-slot="list-item-active-icon"] {
  174. display: none;
  175. align-items: center;
  176. justify-content: center;
  177. flex-shrink: 0;
  178. aspect-ratio: 1/1;
  179. [data-component="icon"] {
  180. color: var(--icon-strong-base);
  181. }
  182. }
  183. [data-slot="list-item-extra-icon"] {
  184. color: var(--icon-base);
  185. margin-left: -4px;
  186. }
  187. &[data-active="true"] {
  188. border-radius: var(--radius-md);
  189. background: var(--surface-raised-base-hover);
  190. [data-slot="list-item-active-icon"] {
  191. display: inline-flex;
  192. }
  193. [data-slot="list-item-extra-icon"] {
  194. display: block !important;
  195. color: var(--icon-strong-base) !important;
  196. }
  197. }
  198. &:active {
  199. background: var(--surface-raised-base-active);
  200. }
  201. &:focus-visible {
  202. outline: none;
  203. }
  204. }
  205. }
  206. }
  207. }
  208. }