| new file mode 100644 |
| index 0000000..84e5031 |
| --- /dev/null |
| +++ b/internal/slides/static/brand/light.css |
| @@ -0,0 +1,154 @@ |
| +/* light.css — the light, for Slides: Docs' brand/light.css (design/ |
| + richer-ui, at "a press is press in and bloom, with no dark mark" and |
| + "every glow much fainter in dark mode"), on Slides' own attributes and |
| + accent. A page opts in by linking this and brand/pointer.js; nothing |
| + here does anything to a page that does not. |
| + |
| + The vocabulary, all opt-in, all generic: |
| + |
| + [slides-lit] a surface a pool of the accent's light follows the |
| + pointer across (a list row, a menu item, a panel), |
| + and a press blooms on. |
| + [slides-press] a control that gives a little under a press and |
| + springs back, overshooting slightly. Its scale is |
| + --slides-press-scale (0.965 by default). |
| + [slides-lift] a tile whose [slides-lift-face] (its picture) is |
| + picked up: it lifts toward the reader a little |
| + larger, takes the accent's edge, leans a few degrees |
| + toward the pointer, carries the light, and gives |
| + under a press. |
| + [rst-btn] rastrillo's buttons on such a page press in and |
| + bloom too: white on a filled button. This rastrillo |
| + has no press value or face layer of its own (Docs' |
| + newer one does), so the bloom rides here. |
| + |
| + Positions come from pointer.js: --rst-mx/--rst-my (the pointer, in |
| + the element's own pixels: rastrillo light.js's names, so one |
| + vocabulary lights both), --slides-tx/--slides-ty (the same, -1 to 1 |
| + across the element, for the lean), and --rst-px/--rst-py (where a |
| + press landed). Every one has a default here, so with no script the |
| + page is the still design. Hover light only under (hover: hover), so a |
| + touch screen never holds a light where a finger lifted; motion is |
| + dropped under reduced motion, where the edge alone says the same |
| + thing. |
| + |
| + In dark every glow is far fainter: light on a dark surface reads much |
| + brighter than on a light one (Paul, 2026-11-10). */ |
| +:root { |
| + /* The bloom's light, as an rgb triplet so its alpha can follow the |
| + press: rgb(var() / calc()) works in every engine, where a |
| + color-mix() whose percentage carried calc(var()) blanked Safari. |
| + Slides' accent (estilo theme/apps.go, hue 56), light and dark. */ |
| + --slides-bloom: 146 75 0; |
| + /* How strong every bloom is: 1 in light, much less in dark. */ |
| + --slides-bloom-k: 1; |
| + /* The pool of light a pointer casts on what it is over. */ |
| + --slides-light-tint: light-dark(color-mix(in srgb, var(--rst-accent) 10%, transparent), color-mix(in srgb, var(--rst-accent) 6%, transparent)); |
| +} |
| +/* Dark, a triplet, so a selector and a media query rather than |
| + light-dark(), which takes only colours. */ |
| +:root[data-theme="dark"] { --slides-bloom: 235 156 98; --slides-bloom-k: 0.4; } |
| +@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --slides-bloom: 235 156 98; --slides-bloom-k: 0.4; } } |
| + |
| +/* A press is press in and bloom: the control gives under the press and |
| + springs back on release; the light flares where the press landed, |
| + swelling while it is held and fading after release. --slides-press is |
| + 1 while held, at once, and falls to 0 over 0.7s, which a registered |
| + number can transition; the flare's size and alpha both ride it. |
| + Inherited, so a lifted tile's face reads its tile's press. */ |
| +@property --slides-press { |
| + syntax: "<number>"; |
| + inherits: true; |
| + initial-value: 0; |
| +} |
| +:root { |
| + --slides-flare: radial-gradient(calc(24px + var(--slides-press, 0) * 76px) circle at var(--rst-px, 50%) var(--rst-py, 50%), rgb(var(--slides-bloom) / calc(var(--slides-press, 0) * 0.16 * var(--slides-bloom-k))), transparent 72%); |
| + --slides-flare-on-fill: radial-gradient(calc(24px + var(--slides-press, 0) * 96px) circle at var(--rst-px, 50%) var(--rst-py, 50%), rgb(255 255 255 / calc(var(--slides-press, 0) * 0.22 * var(--slides-bloom-k))), transparent 72%); |
| + --slides-release: --slides-press 0.7s cubic-bezier(0.2, 0.6, 0.3, 1), scale 0.42s cubic-bezier(0.3, 1.6, 0.5, 1); |
| +} |
| + |
| +[slides-lit], |
| +[slides-press], |
| +[slides-lift], |
| +[rst-btn] { |
| + transition: var(--slides-release), background-color 150ms ease, border-color 150ms ease, color 150ms ease; |
| +} |
| +[slides-lit]:active, |
| +[slides-press]:active:not(:disabled):not([aria-disabled="true"]), |
| +[slides-lift]:active, |
| +[rst-btn]:active:not(:disabled):not([aria-busy="true"]) { |
| + --slides-press: 1; |
| + transition: scale 90ms ease-out; |
| +} |
| +[slides-press]:active:not(:disabled):not([aria-disabled="true"]) { scale: var(--slides-press-scale, 0.965); } |
| +[rst-btn]:active:not(:disabled):not([aria-busy="true"]) { scale: 0.965; } |
| +[slides-lit] { background-image: var(--slides-flare); } |
| +[slides-press]:not([slides-lit]), |
| +[rst-btn] { background-image: var(--slides-flare); } |
| +[rst-btn~="primary"], |
| +[rst-btn~="danger"] { background-image: var(--slides-flare-on-fill); } |
| + |
| +@media (hover: hover) { |
| + /* The second selector is a rastrillo row: its own hover fill is a |
| + background shorthand under a :has() that outweighs the first, and |
| + would take the light away exactly while the pointer is on it. */ |
| + [slides-lit]:hover, |
| + [rst-row][slides-lit]:has(> [rst-row-main] > a):hover { |
| + background-image: var(--slides-flare), radial-gradient(var(--slides-light-size, 280px) circle at var(--rst-mx, 50%) var(--rst-my, 50%), var(--slides-light-tint), transparent 70%); |
| + } |
| +} |
| + |
| +/* The lifted tile. The face is what moves: the tile itself (a link, |
| + title and all) stays where it is, so its hit area never slides out |
| + from under the pointer. The lean's transition is what makes it follow |
| + the pointer rather than jump. */ |
| +[slides-lift] [slides-lift-face] { |
| + position: relative; |
| + transition: transform 180ms cubic-bezier(.2, .7, .2, 1), box-shadow 180ms ease, scale 0.42s cubic-bezier(0.3, 1.6, 0.5, 1); |
| +} |
| +[slides-lift] [slides-lift-face]::after { |
| + content: ""; |
| + position: absolute; |
| + inset: 0; |
| + border-radius: inherit; |
| + background: |
| + var(--slides-flare), |
| + radial-gradient(180px circle at var(--rst-mx, 50%) var(--rst-my, 0%), var(--slides-light-tint), transparent 70%); |
| + opacity: 0; |
| + transition: opacity 200ms ease; |
| + pointer-events: none; |
| +} |
| +[slides-lift]:active [slides-lift-face]::after { |
| + opacity: 1; |
| +} |
| +[slides-lift]:hover [slides-lift-face], |
| +[slides-lift]:focus-visible [slides-lift-face] { |
| + transform: translateY(-6px) perspective(800px) |
| + rotateX(calc(var(--slides-ty, 0) * -4deg)) |
| + rotateY(calc(var(--slides-tx, 0) * 5deg)) |
| + scale(1.04); |
| + box-shadow: |
| + 0 0 0 1.5px var(--rst-accent), |
| + 0 2px 4px rgb(23 32 60 / 0.08), |
| + 0 18px 32px -14px light-dark(rgb(23 32 60 / 0.35), rgb(0 0 0 / 0.8)); |
| +} |
| +[slides-lift]:active [slides-lift-face] { |
| + scale: 0.97; |
| + transition: transform 180ms cubic-bezier(.2, .7, .2, 1), box-shadow 180ms ease, scale 90ms ease-out; |
| +} |
| +@media (hover: hover) { |
| + [slides-lift]:hover [slides-lift-face]::after { |
| + opacity: 1; |
| + } |
| +} |
| + |
| +@media (prefers-reduced-motion: reduce) { |
| + [slides-press]:active, [rst-btn]:active, [slides-lift]:active [slides-lift-face] { scale: none; } |
| + [slides-lift] [slides-lift-face] { transition: none; } |
| + [slides-lift]:hover [slides-lift-face], |
| + [slides-lift]:focus-visible [slides-lift-face] { transform: none; } |
| +} |
| +@media (forced-colors: active) { |
| + [slides-lit], [slides-press], [rst-btn] { background-image: none; } |
| + [slides-lift] [slides-lift-face]::after { content: none; } |
| +} |