list.css 6.6 KB

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