dialog.css 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /* [data-component="dialog-trigger"] { } */
  2. [data-component="dialog-overlay"] {
  3. position: fixed;
  4. inset: 0;
  5. z-index: 50;
  6. background-color: hsl(from var(--background-base) h s l / 0.2);
  7. /* animation: overlayHide 250ms ease 100ms forwards; */
  8. /**/
  9. /* &[data-expanded] { */
  10. /* animation: overlayShow 250ms ease; */
  11. /* } */
  12. }
  13. [data-component="dialog"] {
  14. position: fixed;
  15. inset: 0;
  16. z-index: 50;
  17. display: flex;
  18. align-items: center;
  19. justify-content: center;
  20. [data-slot="dialog-container"] {
  21. position: relative;
  22. z-index: 50;
  23. width: min(calc(100vw - 16px), 640px);
  24. height: min(calc(100vh - 16px), 512px);
  25. display: flex;
  26. flex-direction: column;
  27. align-items: center;
  28. justify-items: start;
  29. overflow: visible;
  30. [data-slot="dialog-content"] {
  31. display: flex;
  32. flex-direction: column;
  33. align-items: flex-start;
  34. align-self: stretch;
  35. width: 100%;
  36. max-height: 100%;
  37. min-height: 280px;
  38. overflow: auto;
  39. /* Hide scrollbar */
  40. scrollbar-width: none;
  41. -ms-overflow-style: none;
  42. &::-webkit-scrollbar {
  43. display: none;
  44. }
  45. /* padding: 8px; */
  46. /* padding: 8px 8px 0 8px; */
  47. border: 1px solid
  48. light-dark(
  49. color-mix(in oklch, var(--border-base) 30%, transparent),
  50. color-mix(in oklch, var(--border-base) 50%, transparent)
  51. );
  52. border-radius: var(--radius-xl);
  53. background: var(--surface-raised-stronger-non-alpha);
  54. background-clip: padding-box;
  55. box-shadow: var(--shadow-lg);
  56. /* animation: contentHide 300ms ease-in forwards; */
  57. /**/
  58. /* &[data-expanded] { */
  59. /* animation: contentShow 300ms ease-out; */
  60. /* } */
  61. [data-slot="dialog-header"] {
  62. display: flex;
  63. padding: 16px 16px 16px 24px;
  64. justify-content: space-between;
  65. align-items: center;
  66. flex-shrink: 0;
  67. align-self: stretch;
  68. [data-slot="dialog-title"] {
  69. color: var(--text-strong);
  70. /* text-16-medium */
  71. font-family: var(--font-family-sans);
  72. font-size: var(--font-size-large);
  73. font-style: normal;
  74. font-weight: var(--font-weight-medium);
  75. line-height: var(--line-height-x-large); /* 150% */
  76. letter-spacing: var(--letter-spacing-tight);
  77. }
  78. /* [data-slot="dialog-close-button"] {} */
  79. }
  80. [data-slot="dialog-description"] {
  81. display: flex;
  82. padding: 16px;
  83. padding-left: 24px;
  84. padding-top: 0;
  85. margin-top: -8px;
  86. justify-content: space-between;
  87. align-items: center;
  88. flex-shrink: 0;
  89. align-self: stretch;
  90. color: var(--text-base);
  91. /* text-14-regular */
  92. font-family: var(--font-family-sans);
  93. font-size: 14px;
  94. font-style: normal;
  95. font-weight: var(--font-weight-regular);
  96. line-height: var(--line-height-large); /* 142.857% */
  97. letter-spacing: var(--letter-spacing-normal);
  98. }
  99. [data-slot="dialog-body"] {
  100. width: 100%;
  101. position: relative;
  102. display: flex;
  103. flex-direction: column;
  104. flex: 1;
  105. overflow: hidden;
  106. &:focus-visible {
  107. outline: none;
  108. }
  109. }
  110. &:focus-visible {
  111. outline: none;
  112. }
  113. }
  114. }
  115. &[data-fit] {
  116. [data-slot="dialog-container"] {
  117. height: auto;
  118. [data-slot="dialog-content"] {
  119. min-height: 0;
  120. }
  121. }
  122. }
  123. &[data-size="large"] [data-slot="dialog-container"] {
  124. width: min(calc(100vw - 32px), 800px);
  125. height: min(calc(100vh - 32px), 600px);
  126. }
  127. }
  128. @keyframes overlayShow {
  129. from {
  130. opacity: 0;
  131. }
  132. to {
  133. opacity: 1;
  134. }
  135. }
  136. @keyframes overlayHide {
  137. from {
  138. opacity: 1;
  139. }
  140. to {
  141. opacity: 0;
  142. }
  143. }
  144. @keyframes contentShow {
  145. from {
  146. opacity: 0;
  147. transform: scale(0.96);
  148. }
  149. to {
  150. opacity: 1;
  151. transform: scale(1);
  152. }
  153. }
  154. @keyframes contentHide {
  155. from {
  156. opacity: 1;
  157. transform: scale(1);
  158. }
  159. to {
  160. opacity: 0;
  161. transform: scale(0.96);
  162. }
  163. }