| 1 | /* shell.css — the slide between the index and a page on a phone, for |
| 2 | the sidebar and console shells, the only layouts that link it. |
| 3 | |
| 4 | It is a file of its own because the opt-in cannot be scoped: written |
| 5 | in tokens.css, @view-transition would opt every page of every shell |
| 6 | into cross-document transitions at narrow widths, the sign-in page |
| 7 | included. Both documents must opt in, and a stylesheet only these two |
| 8 | shells link is exactly that set. Delete it (and its <link>) and |
| 9 | navigation is instant; nothing else changes. |
| 10 | |
| 11 | shell.js types each transition "forward" or "back" in pagereveal. |
| 12 | Each :active-view-transition-type() selector is a rule of its own: an |
| 13 | engine that does not know the pseudo-class drops the whole rule, and a |
| 14 | co-listed selector would take its neighbours with it (the trap the |
| 15 | console's rules in tokens.css record). The slide is a physical |
| 16 | translateX, so a right-to-left page has four rules of its own that |
| 17 | slide the other way. Under reduced motion nothing opts in and |
| 18 | navigation is instant; the block at the end sets every animation here |
| 19 | to none as well, which is the form the motion gate reads. */ |
| 20 | @media (max-width: 799.98px) and (prefers-reduced-motion: no-preference) { |
| 21 | @view-transition { navigation: auto; } |
| 22 | ::view-transition-group(root) { animation-duration: 0.32s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); } |
| 23 | html:active-view-transition-type(forward)::view-transition-old(root) { animation: 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both rst-shell-out-start; } |
| 24 | html:active-view-transition-type(forward)::view-transition-new(root) { animation: 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both rst-shell-in-end; } |
| 25 | html:active-view-transition-type(back)::view-transition-old(root) { animation: 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both rst-shell-out-end; z-index: 1; } |
| 26 | html:active-view-transition-type(back)::view-transition-new(root) { animation: 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both rst-shell-in-start; } |
| 27 | html[dir="rtl"]:active-view-transition-type(forward)::view-transition-old(root) { animation: 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both rst-shell-out-start-rtl; } |
| 28 | html[dir="rtl"]:active-view-transition-type(forward)::view-transition-new(root) { animation: 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both rst-shell-in-end-rtl; } |
| 29 | html[dir="rtl"]:active-view-transition-type(back)::view-transition-old(root) { animation: 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both rst-shell-out-end-rtl; z-index: 1; } |
| 30 | html[dir="rtl"]:active-view-transition-type(back)::view-transition-new(root) { animation: 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both rst-shell-in-start-rtl; } |
| 31 | /* The console's bar holds still while the page under it slides. */ |
| 32 | .rst-shell-console > .rst-shell__bar, [rst-shell-console] > [rst-shell-bar] { view-transition-name: rst-shell-bar; } |
| 33 | } |
| 34 | @keyframes rst-shell-in-end { from { transform: translateX(100%); } } |
| 35 | @keyframes rst-shell-out-start { to { opacity: 0.7; transform: translateX(-25%); } } |
| 36 | @keyframes rst-shell-in-start { from { opacity: 0.7; transform: translateX(-25%); } } |
| 37 | @keyframes rst-shell-out-end { to { transform: translateX(100%); } } |
| 38 | @keyframes rst-shell-in-end-rtl { from { transform: translateX(-100%); } } |
| 39 | @keyframes rst-shell-out-start-rtl { to { opacity: 0.7; transform: translateX(25%); } } |
| 40 | @keyframes rst-shell-in-start-rtl { from { opacity: 0.7; transform: translateX(25%); } } |
| 41 | @keyframes rst-shell-out-end-rtl { to { transform: translateX(-100%); } } |
| 42 | @media (prefers-reduced-motion: reduce) { |
| 43 | html:active-view-transition-type(forward)::view-transition-old(root) { animation: none; } |
| 44 | html:active-view-transition-type(forward)::view-transition-new(root) { animation: none; } |
| 45 | html:active-view-transition-type(back)::view-transition-old(root) { animation: none; } |
| 46 | html:active-view-transition-type(back)::view-transition-new(root) { animation: none; } |
| 47 | html[dir="rtl"]:active-view-transition-type(forward)::view-transition-old(root) { animation: none; } |
| 48 | html[dir="rtl"]:active-view-transition-type(forward)::view-transition-new(root) { animation: none; } |
| 49 | html[dir="rtl"]:active-view-transition-type(back)::view-transition-old(root) { animation: none; } |
| 50 | html[dir="rtl"]:active-view-transition-type(back)::view-transition-new(root) { animation: none; } |
| 51 | } |
| 52 | |