list.css 6.0 KB

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