dialog.css 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. [data-slot="dialog-content"] {
  30. display: flex;
  31. flex-direction: column;
  32. align-items: flex-start;
  33. align-self: stretch;
  34. width: 100%;
  35. max-height: 100%;
  36. min-height: 280px;
  37. /* padding: 8px; */
  38. /* padding: 8px 8px 0 8px; */
  39. border: 1px solid
  40. light-dark(
  41. color-mix(in oklch, var(--border-base) 30%, transparent),
  42. color-mix(in oklch, var(--border-base) 50%, transparent)
  43. );
  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);
  48. /* animation: contentHide 300ms ease-in forwards; */
  49. /**/
  50. /* &[data-expanded] { */
  51. /* animation: contentShow 300ms ease-out; */
  52. /* } */
  53. [data-slot="dialog-header"] {
  54. display: flex;
  55. padding: 16px 16px 16px 24px;
  56. justify-content: space-between;
  57. align-items: center;
  58. flex-shrink: 0;
  59. align-self: stretch;
  60. [data-slot="dialog-title"] {
  61. color: var(--text-strong);
  62. /* text-16-medium */
  63. font-family: var(--font-family-sans);
  64. font-size: var(--font-size-large);
  65. font-style: normal;
  66. font-weight: var(--font-weight-medium);
  67. line-height: var(--line-height-x-large); /* 150% */
  68. letter-spacing: var(--letter-spacing-tight);
  69. }
  70. /* [data-slot="dialog-close-button"] {} */
  71. }
  72. [data-slot="dialog-description"] {
  73. display: flex;
  74. padding: 16px;
  75. padding-left: 24px;
  76. padding-top: 0;
  77. margin-top: -8px;
  78. justify-content: space-between;
  79. align-items: center;
  80. flex-shrink: 0;
  81. align-self: stretch;
  82. color: var(--text-base);
  83. /* text-14-regular */
  84. font-family: var(--font-family-sans);
  85. font-size: 14px;
  86. font-style: normal;
  87. font-weight: var(--font-weight-regular);
  88. line-height: var(--line-height-large); /* 142.857% */
  89. letter-spacing: var(--letter-spacing-normal);
  90. }
  91. [data-slot="dialog-body"] {
  92. width: 100%;
  93. position: relative;
  94. display: flex;
  95. flex-direction: column;
  96. flex: 1;
  97. overflow-y: auto;
  98. &:focus-visible {
  99. outline: none;
  100. }
  101. }
  102. &:focus-visible {
  103. outline: none;
  104. }
  105. }
  106. &:focus-visible {
  107. outline: none;
  108. }
  109. }
  110. }
  111. @keyframes overlayShow {
  112. from {
  113. opacity: 0;
  114. }
  115. to {
  116. opacity: 1;
  117. }
  118. }
  119. @keyframes overlayHide {
  120. from {
  121. opacity: 1;
  122. }
  123. to {
  124. opacity: 0;
  125. }
  126. }
  127. @keyframes contentShow {
  128. from {
  129. opacity: 0;
  130. transform: scale(0.96);
  131. }
  132. to {
  133. opacity: 1;
  134. transform: scale(1);
  135. }
  136. }
  137. @keyframes contentHide {
  138. from {
  139. opacity: 1;
  140. transform: scale(1);
  141. }
  142. to {
  143. opacity: 0;
  144. transform: scale(0.96);
  145. }
  146. }