| index e59f241..37dacc4 100644 |
| --- a/internal/docs/brand/light.css |
| +++ b/internal/docs/brand/light.css |
| @@ -10,36 +10,36 @@ |
| --rst-sheen-plain: light-dark(color-mix(in srgb, var(--rst-accent) 10%, transparent), rgba(255, 255, 255, 0.05)); |
| --rst-light-rim: light-dark(color-mix(in srgb, var(--rst-accent) 38%, var(--rst-line)), color-mix(in srgb, var(--rst-accent) 40%, #505050)); |
| --rst-light-wash: light-dark(color-mix(in srgb, var(--rst-accent) 4%, transparent), rgba(255, 255, 255, 0.025)); |
| - /* A press: rastrillo's strengths (its day theme), which light up its |
| - own buttons' press spot and wash, and which Docs' controls below |
| - read the same way. */ |
| - --rst-press-wash: 0.08; |
| - --rst-press-spot: 0.16; |
| - --rst-press-wash-plain: 0.04; |
| - --rst-press-spot-plain: 0.07; |
| + /* 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 |
| + (rastrillo's tokens.css, on its own press). Docs' accent, light and |
| + dark. */ |
| + --docs-bloom: 46 91 180; |
| /* The pool of light a pointer casts on the control it is over. */ |
| --docs-light-tint: light-dark(color-mix(in srgb, var(--rst-accent) 10%, transparent), color-mix(in srgb, var(--rst-accent) 16%, transparent)); |
| } |
| -/* Dark, as rastrillo's day theme has it: numbers, so a selector and a |
| - media query rather than light-dark(), which takes only colours. */ |
| -:root[data-theme="dark"] { --rst-press-wash: 0.18; --rst-press-spot: 0.30; --rst-press-wash-plain: 0.18; --rst-press-spot-plain: 0.30; } |
| -@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --rst-press-wash: 0.18; --rst-press-spot: 0.30; --rst-press-wash-plain: 0.18; --rst-press-spot-plain: 0.30; } } |
| +/* Dark, a triplet, so a selector and a media query rather than |
| + light-dark(), which takes only colours. */ |
| +:root[data-theme="dark"] { --docs-bloom: 135 177 253; } |
| +@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --docs-bloom: 135 177 253; } } |
| |
| -/* A press, on Docs' own controls, the way rastrillo presses its |
| - buttons: --docs-press is 1 while held, at once, and fades to 0 over |
| - 0.7s after release, which is what a registered number can transition; |
| - --docs-spot is the mark it leaves, darkest where the press landed |
| - (pointer.js writes --rst-px/--rst-py), drawn as a background layer by |
| - each control's own rule. And the control gives a little under the |
| - press and springs back on release, overshooting slightly. |
| - Inherited, so a shelf page's paper can read its tile's press. */ |
| +/* A press is press in and bloom (Paul, from the press lab): the |
| + control gives a little under the press and springs back on release, |
| + overshooting slightly; and the light flares where the press landed |
| + (pointer.js writes --rst-px/--rst-py), swelling while it is held and |
| + fading after release. --docs-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. --docs-flare is that light, drawn |
| + as a background layer by each control's own rule. Inherited, so a |
| + shelf page's paper can read its tile's press. */ |
| @property --docs-press { |
| syntax: "<number>"; |
| inherits: true; |
| initial-value: 0; |
| } |
| :root { |
| - --docs-spot: radial-gradient(70px circle at var(--rst-px, 50%) var(--rst-py, 50%), rgb(0 0 0 / calc(var(--docs-press, 0) * var(--rst-press-spot-plain, 0))), transparent 75%); |
| + --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)), transparent 72%); |
| --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); |
| } |
| [docs-tool], |
| @@ -58,10 +58,21 @@ |
| [docs-tool]:active:not(:disabled) { scale: 0.92; } |
| [docs-list] [rst-row]:active { scale: 0.992; } |
| [estilo-menu-item]:not(:disabled) { |
| - background-image: var(--docs-spot); |
| + background-image: var(--docs-flare); |
| +} |
| +/* rastrillo's buttons carry their own press value, --rst-press (1 while |
| + held, fading over 0.7s), and a face layer under everything else: the |
| + bloom goes in the face, white on a filled button, and they give under |
| + the press the same way, keeping their own transitions. */ |
| +[rst-btn] { |
| + --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)), transparent 72%); |
| +} |
| +[rst-btn~="primary"], |
| +[rst-btn~="danger"] { |
| + --rst-btn-face: |
| + 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)), transparent 72%), |
| + linear-gradient(rgb(255 255 255 / var(--rst-depth-face, 0)), rgb(0 0 0 / var(--rst-depth-face, 0))); |
| } |
| -/* rastrillo's buttons already draw the spot and the fade; they give |
| - under the press the same way, keeping their own transitions. */ |
| [rst-btn] { |
| 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); |
| } |
| @@ -76,7 +87,7 @@ |
| @media (hover: hover) { |
| /* A menu's rows: the hover fill estilo draws, with the light on it. */ |
| [estilo-menu-item]:hover:not(:disabled) { |
| - background-image: var(--docs-spot), radial-gradient(120px circle at var(--rst-mx, 50%) var(--rst-my, 50%), var(--docs-light-tint), transparent 70%); |
| + background-image: var(--docs-flare), radial-gradient(120px circle at var(--rst-mx, 50%) var(--rst-my, 50%), var(--docs-light-tint), transparent 70%); |
| } |
| } |
| |