|
90 | 90 | overflow-x: auto;
|
91 | 91 | overscroll-behavior-x: contain;
|
92 | 92 | scroll-snap-type: x mandatory;
|
93 |
| -
|
94 |
| - container-type: scroll-state; |
95 | 93 | anchor-name: --carousel;
|
96 | 94 |
|
97 | 95 | > li {
|
|
103 | 101 | overflow-x: auto;
|
104 | 102 | overscroll-behavior-x: contain;
|
105 | 103 | scroll-snap-type: x mandatory;
|
106 |
| -
|
107 |
| - container-type: scroll-state; |
108 | 104 | anchor-name: --carousel;
|
109 | 105 |
|
110 | 106 | columns: 1;
|
|
171 | 167 | }
|
172 | 168 | }`}{/if}
|
173 | 169 | </code></pre></div>{/if}
|
| 170 | + |
| 171 | +{#if inerted === 'Yes'} |
| 172 | + <div> |
| 173 | + <p>Inert Interactivity</p> |
| 174 | + {#if paged === 'No'}<pre><code>{`.carousel { |
| 175 | + > li { |
| 176 | + container-type: scroll-state; |
| 177 | +
|
| 178 | + > .card { |
| 179 | + @container not scroll-state(snapped: x) { |
| 180 | + interactivity: inert; |
| 181 | + opacity: .25; |
| 182 | + } |
| 183 | + } |
| 184 | + } |
| 185 | +} |
| 186 | +`}</code></pre>{/if} |
| 187 | + {#if paged === 'Yes'}<pre><code>{`.carousel { |
| 188 | + &::column { |
| 189 | + container-type: scroll-state; |
| 190 | +
|
| 191 | + > .card { |
| 192 | + @container not scroll-state(snapped: x) { |
| 193 | + interactivity: inert; |
| 194 | + opacity: .25; |
| 195 | + } |
| 196 | + } |
| 197 | + } |
| 198 | +}`}</code></pre>{/if} |
| 199 | + </div> |
| 200 | +{/if} |
174 | 201 | </div>
|
175 | 202 |
|
| 203 | +{@html `<style>${` |
| 204 | + .with-inert .card { |
| 205 | + transition: opacity .5s ease; |
| 206 | +
|
| 207 | + @container not scroll-state(snapped: x) { |
| 208 | + interactivity: inert; |
| 209 | + opacity: .25; |
| 210 | + } |
| 211 | + } |
| 212 | +}`}</style>`} |
| 213 | + |
176 | 214 | <style>
|
177 | 215 | .carousel {
|
178 | 216 | /* Scrolling behavior. */
|
179 |
| - overflow: auto; |
| 217 | + overflow-x: auto; |
180 | 218 | scroll-behavior: smooth;
|
181 | 219 | overscroll-behavior-x: contain;
|
182 | 220 | scrollbar-width: none;
|
|
189 | 227 | /* Styles and layout */
|
190 | 228 | padding: var(--size-3);
|
191 | 229 | scroll-padding: var(--size-3);
|
192 |
| - resize: both; |
193 | 230 |
|
194 | 231 | container-type: inline-size scroll-state;
|
195 | 232 | inline-size: 1024px;
|
|
200 | 237 | &.with-pages {
|
201 | 238 | columns: 1;
|
202 | 239 | block-size: 13lh;
|
| 240 | + resize: both; |
203 | 241 | text-align: center;
|
204 | 242 |
|
205 | 243 | & > li {
|
|
209 | 247 |
|
210 | 248 | &::column {
|
211 | 249 | scroll-snap-align: center;
|
| 250 | + container-type: scroll-state; |
212 | 251 | }
|
213 | 252 | }
|
214 | 253 |
|
|
220 | 259 |
|
221 | 260 | & > li {
|
222 | 261 | scroll-snap-align: center;
|
| 262 | + container-type: scroll-state; |
223 | 263 | }
|
224 | 264 | }
|
225 | 265 |
|
226 | 266 | & li {
|
| 267 | + container-type: scroll-state; |
227 | 268 | padding: 0;
|
228 | 269 | display: inline-grid;
|
229 | 270 | counter-increment: item;
|
|
246 | 287 | &:focus {
|
247 | 288 | outline: 2px solid var(--link);
|
248 | 289 | }
|
249 |
| -
|
250 |
| - /* @container scroll-state(snapped: x) { |
251 |
| - outline: 2px solid red; |
252 |
| - } */ |
253 | 290 | }
|
254 | 291 |
|
255 | 292 | /* Scroll marker pages */
|
|
393 | 430 |
|
394 | 431 | & > section {
|
395 | 432 | display: grid;
|
396 |
| - gap: var(--size-2); |
| 433 | + gap: var(--size-8); |
| 434 | +
|
| 435 | + & > div { |
| 436 | + display: grid; |
| 437 | + align-items: start; |
| 438 | +
|
| 439 | + & > * { |
| 440 | + grid-area: 1/1; |
| 441 | + } |
| 442 | + } |
397 | 443 |
|
398 | 444 | & p {
|
399 |
| - margin-block-end: var(--size-2); |
| 445 | + z-index: 1; |
| 446 | + margin-block-start: -.75lh; |
| 447 | + margin-inline-start: .5lh; |
400 | 448 | max-inline-size: max-content;
|
401 |
| - padding-inline: .75ch; |
| 449 | + padding-inline: 1ch; |
402 | 450 | padding-block: .25ch;
|
403 |
| - background: var(--surface-2); |
404 |
| - border-radius: var(--radius-2); |
| 451 | + background: light-dark(white, var(--surface-2)); |
| 452 | + border-radius: var(--radius-round); |
| 453 | + box-shadow: var(--shadow-3); |
405 | 454 | }
|
406 | 455 | }
|
407 | 456 |
|
|
0 commit comments