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-radius: var(--radius-xl);
  48. background: var(--surface-raised-stronger-non-alpha);
  49. background-clip: padding-box;
  50. box-shadow: var(--shadow-lg-border-base);
  51. /* animation: contentHide 300ms ease-in forwards; */
  52. /**/
  53. /* &[data-expanded] { */
  54. /* animation: contentShow 300ms ease-out; */
  55. /* } */
  56. [data-slot="dialog-header"] {
  57. display: flex;
  58. padding: 16px 16px 16px 24px;
  59. justify-content: space-between;
  60. align-items: center;
  61. flex-shrink: 0;
  62. align-self: stretch;
  63. [data-slot="dialog-title"] {
  64. color: var(--text-strong);
  65. /* text-16-medium */
  66. font-family: var(--font-family-sans);
  67. font-size: var(--font-size-large);
  68. font-style: normal;
  69. font-weight: var(--font-weight-medium);
  70. line-height: var(--line-height-x-large); /* 150% */
  71. letter-spacing: var(--letter-spacing-tight);
  72. }
  73. /* [data-slot="dialog-close-button"] {} */
  74. }
  75. [data-slot="dialog-description"] {
  76. display: flex;
  77. padding: 16px;
  78. padding-left: 24px;
  79. padding-top: 0;
  80. margin-top: -8px;
  81. justify-content: space-between;
  82. align-items: center;
  83. flex-shrink: 0;
  84. align-self: stretch;
  85. color: var(--text-base);
  86. /* text-14-regular */
  87. font-family: var(--font-family-sans);
  88. font-size: 14px;
  89. font-style: normal;
  90. font-weight: var(--font-weight-regular);
  91. line-height: var(--line-height-large); /* 142.857% */
  92. letter-spacing: var(--letter-spacing-normal);
  93. }
  94. [data-slot="dialog-body"] {
  95. width: 100%;
  96. position: relative;
  97. display: flex;
  98. flex-direction: column;
  99. flex: 1;
  100. overflow: hidden;
  101. &:focus-visible {
  102. outline: none;
  103. }
  104. }
  105. &:focus-visible {
  106. outline: none;
  107. }
  108. }
  109. }
  110. &[data-fit] {
  111. [data-slot="dialog-container"] {
  112. height: auto;
  113. [data-slot="dialog-content"] {
  114. min-height: 0;
  115. }
  116. }
  117. }
  118. &[data-size="large"] [data-slot="dialog-container"] {
  119. width: min(calc(100vw - 32px), 800px);
  120. height: min(calc(100vh - 32px), 600px);
  121. }
  122. &[data-size="x-large"] [data-slot="dialog-container"] {
  123. width: min(calc(100vw - 32px), 960px);
  124. height: min(calc(100vh - 32px), 600px);
  125. }
  126. }
  127. @keyframes overlayShow {
  128. from {
  129. opacity: 0;
  130. }
  131. to {
  132. opacity: 1;
  133. }
  134. }
  135. @keyframes overlayHide {
  136. from {
  137. opacity: 1;
  138. }
  139. to {
  140. opacity: 0;
  141. }
  142. }
  143. @keyframes contentShow {
  144. from {
  145. opacity: 0;
  146. transform: scale(0.96);
  147. }
  148. to {
  149. opacity: 1;
  150. transform: scale(1);
  151. }
  152. }
  153. @keyframes contentHide {
  154. from {
  155. opacity: 1;
  156. transform: scale(1);
  157. }
  158. to {
  159. opacity: 0;
  160. transform: scale(0.96);
  161. }
  162. }