| 1 | /* The light, for Docs (in dark, every glow far fainter: light on a dark |
| 2 | surface reads much brighter than on a light one, Paul 2026-11-10): the values rastrillo's depth styles read (its |
| 3 | day theme's names, ui/themes/day.css), which estilo's Calma does not |
| 4 | declare yet, and the same light on Docs' own controls. Positions come |
| 5 | from rastrillo's light.js (its buttons and cards) and from |
| 6 | pointer.js (everything here); with neither, every rule below falls |
| 7 | back to the still design. Hover-only, and under (hover: hover), so a |
| 8 | touch screen never holds a light where a finger lifted. */ |
| 9 | :root { |
| 10 | --rst-sheen-fill: light-dark(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.035)); |
| 11 | --rst-sheen-plain: light-dark(color-mix(in srgb, var(--rst-accent) 10%, transparent), rgba(255, 255, 255, 0.025)); |
| 12 | --rst-light-rim: light-dark(color-mix(in srgb, var(--rst-accent) 38%, var(--rst-line)), color-mix(in srgb, var(--rst-accent) 18%, #4a4a4a)); |
| 13 | --rst-light-wash: light-dark(color-mix(in srgb, var(--rst-accent) 4%, transparent), rgba(255, 255, 255, 0.01)); |
| 14 | /* The bloom's light, as an rgb triplet so its alpha can follow the |
| 15 | press: rgb(var() / calc()) works in every engine, where a |
| 16 | color-mix() whose percentage carried calc(var()) blanked Safari |
| 17 | (rastrillo's tokens.css, on its own press). Docs' accent, light and |
| 18 | dark. */ |
| 19 | --docs-bloom: 46 91 180; |
| 20 | /* How strong every press bloom is: 1 in light, much less in dark, |
| 21 | where light on a dark surface reads far brighter (Paul). */ |
| 22 | --docs-bloom-k: 1; |
| 23 | /* The pool of light a pointer casts on the control it is over. */ |
| 24 | --docs-light-tint: light-dark(color-mix(in srgb, var(--rst-accent) 10%, transparent), color-mix(in srgb, var(--rst-accent) 6%, transparent)); |
| 25 | } |
| 26 | /* Dark, a triplet, so a selector and a media query rather than |
| 27 | light-dark(), which takes only colours. */ |
| 28 | :root[data-theme="dark"] { --docs-bloom: 135 177 253; --docs-bloom-k: 0.4; } |
| 29 | @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --docs-bloom: 135 177 253; --docs-bloom-k: 0.4; } } |
| 30 | |
| 31 | /* A press is press in and bloom (Paul, from the press lab): the |
| 32 | control gives a little under the press and springs back on release, |
| 33 | overshooting slightly; and the light flares where the press landed |
| 34 | (pointer.js writes --rst-px/--rst-py), swelling while it is held and |
| 35 | fading after release. --docs-press is 1 while held, at once, and |
| 36 | falls to 0 over 0.7s, which a registered number can transition; the |
| 37 | flare's size and alpha both ride it. --docs-flare is that light, drawn |
| 38 | as a background layer by each control's own rule. Inherited, so a |
| 39 | shelf page's paper can read its tile's press. */ |
| 40 | @property --docs-press { |
| 41 | syntax: "<number>"; |
| 42 | inherits: true; |
| 43 | initial-value: 0; |
| 44 | } |
| 45 | :root { |
| 46 | --docs-flare: radial-gradient(calc(24px + var(--docs-press, 0) * 76px) circle at var(--rst-px, 50%) var(--rst-py, 50%), rgb(var(--docs-bloom) / calc(var(--docs-press, 0) * 0.16 * var(--docs-bloom-k))), transparent 72%); |
| 47 | --docs-release: --docs-press 0.7s cubic-bezier(0.2, 0.6, 0.3, 1), scale 0.42s cubic-bezier(0.3, 1.6, 0.5, 1); |
| 48 | } |
| 49 | [docs-tool], |
| 50 | [docs-tile], |
| 51 | [docs-list] [rst-row], |
| 52 | [estilo-menu-item] { |
| 53 | transition: var(--docs-release); |
| 54 | } |
| 55 | [docs-tool]:active:not(:disabled), |
| 56 | [docs-tile]:active, |
| 57 | [docs-list] [rst-row]:active, |
| 58 | [estilo-menu-item]:active:not(:disabled) { |
| 59 | --docs-press: 1; |
| 60 | transition: scale 90ms ease-out; |
| 61 | } |
| 62 | /* The give itself only where motion is welcome; the bloom still comes. */ |
| 63 | @media (prefers-reduced-motion: no-preference) { |
| 64 | [docs-tool]:active:not(:disabled) { scale: 0.92; } |
| 65 | [docs-list] [rst-row]:active { scale: 0.992; } |
| 66 | } |
| 67 | [estilo-menu-item]:not(:disabled) { |
| 68 | background-image: var(--docs-flare); |
| 69 | } |
| 70 | /* rastrillo's buttons carry their own press value, --rst-press (1 while |
| 71 | held, fading over 0.7s), and a face layer under everything else: the |
| 72 | bloom goes in the face, white on a filled button, and they give under |
| 73 | the press the same way, keeping their own transitions. */ |
| 74 | [rst-btn] { |
| 75 | --rst-btn-face: radial-gradient(calc(24px + var(--rst-press, 0) * 96px) circle at var(--rst-px, 50%) var(--rst-py, 50%), rgb(var(--docs-bloom) / calc(var(--rst-press, 0) * 0.14 * var(--docs-bloom-k))), transparent 72%); |
| 76 | } |
| 77 | [rst-btn~="primary"], |
| 78 | [rst-btn~="danger"] { |
| 79 | --rst-btn-face: |
| 80 | radial-gradient(calc(24px + var(--rst-press, 0) * 96px) circle at var(--rst-px, 50%) var(--rst-py, 50%), rgb(255 255 255 / calc(var(--rst-press, 0) * 0.22 * var(--docs-bloom-k))), transparent 72%), |
| 81 | linear-gradient(rgb(255 255 255 / var(--rst-depth-face, 0)), rgb(0 0 0 / var(--rst-depth-face, 0))); |
| 82 | } |
| 83 | [rst-btn] { |
| 84 | transition: --rst-press 0.7s cubic-bezier(0.2, 0.6, 0.3, 1), translate 0.3s ease-out, scale 0.42s cubic-bezier(0.3, 1.6, 0.5, 1); |
| 85 | } |
| 86 | [rst-btn]:active:not(:disabled):not([aria-busy="true"]) { |
| 87 | transition: scale 90ms ease-out; |
| 88 | } |
| 89 | @media (prefers-reduced-motion: no-preference) { |
| 90 | [rst-btn]:active:not(:disabled):not([aria-busy="true"]) { scale: 0.965; } |
| 91 | } |
| 92 | |
| 93 | @media (hover: hover) { |
| 94 | /* A menu's rows: the hover fill estilo draws, with the light on it. */ |
| 95 | [estilo-menu-item]:hover:not(:disabled) { |
| 96 | background-image: var(--docs-flare), radial-gradient(120px circle at var(--rst-mx, 50%) var(--rst-my, 50%), var(--docs-light-tint), transparent 70%); |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | /* The menu bar's titles take the pointer, as every other control on the |
| 101 | page does (Paul, 2026-11-07). estilo's menu.css gives them the arrow |
| 102 | on purpose, after desktop menu bars; this is Docs leading, and the |
| 103 | rule belongs in estilo if the suite follows. */ |
| 104 | [estilo-menubar-title] { |
| 105 | cursor: pointer; |
| 106 | } |
| 107 | |