oficina / docs Public

Docs: a press is press in and bloom, with no dark mark

Paul: he meant bloom and press in together. The press's light now
flares where it landed, swelling while held and fading over 0.7s after
release; its size and alpha ride --docs-press (Docs' controls) or
rastrillo's own --rst-press (its buttons, through --rst-btn-face,
white on a filled one). The accent rides an rgb triplet, --docs-bloom,
so the alpha can be calc(var()) safely in Safari. rastrillo's dark
press spot strengths are no longer set.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev a89f7e0b1de1e0fa7be367ed394360c739ce0369 parent f55ca7a
3 files changed, +39 −28
  • internal/docs/brand/light.css +35 −24
  • internal/docs/views/list.html +2 −2
  • internal/docs/views/show.html +2 −2

CI passed — run details

diff --git a/internal/docs/brand/light.css b/internal/docs/brand/light.css
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%);
}
}
diff --git a/internal/docs/views/list.html b/internal/docs/views/list.html
index 173ca25..329dc0a 100644
--- a/internal/docs/views/list.html
+++ b/internal/docs/views/list.html
@@ -337,7 +337,7 @@
position: absolute;
inset: 0;
background:
- var(--docs-spot),
+ var(--docs-flare),
radial-gradient(180px circle at var(--rst-mx, 50%) var(--rst-my, 0%), var(--docs-light-tint), transparent 70%);
opacity: 0;
transition: opacity 200ms ease;
@@ -397,7 +397,7 @@
the accent's light following the pointer along it. */
@media (hover: hover) {
[docs-list] [rst-row]:hover {
- background-image: var(--docs-spot), radial-gradient(280px circle at var(--rst-mx, 50%) var(--rst-my, 50%), var(--docs-light-tint), transparent 70%);
+ background-image: var(--docs-flare), radial-gradient(280px circle at var(--rst-mx, 50%) var(--rst-my, 50%), var(--docs-light-tint), transparent 70%);
}
}
/* Big enough to read the page's shape, its headings and paragraphs,
diff --git a/internal/docs/views/show.html b/internal/docs/views/show.html
index f0511f6..15d8773 100644
--- a/internal/docs/views/show.html
+++ b/internal/docs/views/show.html
@@ -952,7 +952,7 @@
reads as a mistake. */
border-radius: var(--rst-radius-sm);
background: transparent;
- background-image: var(--docs-spot);
+ background-image: var(--docs-flare);
color: var(--rst-text);
font: inherit;
line-height: 1;
@@ -963,7 +963,7 @@
[docs-tool]:hover:not(:disabled) {
background-color: var(--rst-surface-2);
background-image:
- var(--docs-spot),
+ var(--docs-flare),
radial-gradient(40px circle at var(--rst-mx, 50%) var(--rst-my, 50%), color-mix(in srgb, var(--rst-accent) 18%, transparent), transparent 75%);
}
/* aria-pressed is the state, and colour is not allowed to be the only