2
0

dialog.css 3.9 KB

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