|
36 | 36 |
|
37 | 37 | <dialog |
38 | 38 | bind:this={dialogElement} |
39 | | - class="modal-content" |
| 39 | + class="modal-container" |
40 | 40 | class:default={width === 'default'} |
41 | 41 | class:large={width === 'large'} |
42 | 42 | class:small={width === 'small'} |
|
80 | 80 | dialog { |
81 | 81 | display: none; |
82 | 82 | outline: none; |
83 | | - transform: scale(0.95); |
84 | | - transition: transform 250ms cubic-bezier(0.34, 1.35, 0.7, 1); |
85 | | - } |
86 | | -
|
87 | | - dialog::backdrop { |
88 | | - transition: opacity 150ms ease-in; |
89 | | - background-color: rgb(0 0 0 / 0%); |
90 | 83 | } |
91 | 84 |
|
92 | 85 | dialog[open] { |
93 | 86 | display: flex; |
94 | | - transform: scale(1); |
95 | 87 | } |
96 | 88 |
|
97 | 89 | dialog[open]::backdrop { |
98 | | - background-color: var(--clr-overlay-bg); |
99 | | - opacity: 1; |
| 90 | + /* NOTE: temporarily hardcoded var(--clr-overlay-bg); */ |
| 91 | + background-color: color(srgb 0 0 0 / 0.34901960784313724); |
100 | 92 | } |
101 | 93 |
|
102 | | - @starting-style { |
103 | | - dialog[open] { |
104 | | - transform: scale(0.95); |
105 | | - } |
106 | | - dialog[open]::backdrop { |
107 | | - opacity: 0; |
108 | | - } |
| 94 | + html.dark dialog[open]::backdrop { |
| 95 | + /* NOTE: temporarily hardcoded dark var(--clr-overlay-bg); */ |
| 96 | + background-color: color(srgb 0.8392156862745098 0.8392156862745098 0.8392156862745098 / 0.4); |
109 | 97 | } |
110 | 98 |
|
111 | | - .modal-content { |
| 99 | + .modal-container[open]::backdrop { |
| 100 | + animation: dialog-fade 0.15s ease-in; |
| 101 | + } |
| 102 | +
|
| 103 | + .modal-container[open] { |
| 104 | + animation: dialog-zoom 0.25s cubic-bezier(0.34, 1.35, 0.7, 1); |
| 105 | + } |
| 106 | +
|
| 107 | + .modal-container { |
112 | 108 | flex-direction: column; |
113 | 109 |
|
114 | 110 | max-height: calc(100vh - 80px); |
115 | 111 | border-radius: var(--radius-l); |
116 | 112 | background-color: var(--clr-bg-1); |
117 | 113 | box-shadow: var(--fx-shadow-l); |
118 | 114 | } |
| 115 | +
|
119 | 116 | dialog[open] { |
120 | 117 | border: 1px solid var(--clr-border-2); |
121 | 118 | } |
|
148 | 145 | background-color: var(--clr-bg-1); |
149 | 146 | } |
150 | 147 |
|
| 148 | + @keyframes dialog-zoom { |
| 149 | + from { |
| 150 | + transform: scale(0.95); |
| 151 | + } |
| 152 | + to { |
| 153 | + transform: scale(1); |
| 154 | + } |
| 155 | + } |
| 156 | +
|
| 157 | + @keyframes dialog-fade { |
| 158 | + from { |
| 159 | + opacity: 0; |
| 160 | + } |
| 161 | + to { |
| 162 | + opacity: 1; |
| 163 | + } |
| 164 | + } |
| 165 | +
|
151 | 166 | /* MODIFIERS */ |
152 | | - .modal-content.default { |
| 167 | + .modal-container.default { |
153 | 168 | width: 580px; |
154 | 169 | } |
155 | 170 |
|
156 | | - .modal-content.large { |
| 171 | + .modal-container.large { |
157 | 172 | width: 840px; |
158 | 173 | } |
159 | 174 |
|
160 | | - .modal-content.small { |
| 175 | + .modal-container.small { |
161 | 176 | width: 380px; |
162 | 177 | } |
163 | 178 |
|
164 | | - .modal-content.xsmall { |
| 179 | + .modal-container.xsmall { |
165 | 180 | width: 310px; |
166 | 181 | } |
167 | 182 | </style> |
0 commit comments