list.css 5.3 KB

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