oficina / estilo Public
🤖 estilo
> Confirmed 2026-08-31. Paul's ruling: if Docs, Sheets and other > Oficina apps are going to share a design system, estilo makes sense and > should be started, with rastrillo's day theme as its base.
> Ruled, same day. Paul, verbatim: "Let's have estilo just be day > for now, but we can add oficina specific changes and components to it > as we need to." This settles what "as its base" above meant: estilo's > theme is day, not derived from it or based on it — identical. > See "Theme" below. > > Superseded 2026-09-29. Paul chose Calma: estilo's theme is now the > suite's own, not day (decisions table, row 8; "Theme" below). The two > rulings above are kept as the history of how estilo started.
The CARLOS suite's design-system variant. See README.md for what it is.
This file is binding. Where it disagrees with a general skill, this file wins.
---
The one rule
> Two specs are guesses. Two implementations are facts.
So: one app builds a primitive here, and the other adopts it. Not two implementations merged afterwards, and not an interface designed from two specs at once.
A document editor's inspector shows text and style properties. A spreadsheet's shows cell format and data validation. A shape designed from both specs at once risks fitting neither — the second use is what corrects it, and it can only do that if there is something concrete to correct.
Until a second adoption, estilo is a home, not an agreed interface. Treating it as an interface earlier buys exactly the ill-fitting abstraction that building it here was meant to avoid.
(From ui-guidelines-52 via docs-e6, 2026-08-30. Written down because an empty repo invites the opposite.)
---
Settled decisions
| # | Ruling | Rejected | Who, when | |---|---|---|---| | 1 | Shared suite components live here, not in rastrillo's ui | Proposing them to the framework | Paul, 2026-08-30 | | 2 | A separate repo, created before any primitive is written | App-local until a second consumer; a nested module inside an app | Paul, 2026-08-30 | | 3 | Resolved: use released Rastrillo v0.23.0 — §Dependency | Pinning a main pseudo-version | This session, 2026-08-30 | | 4 | Estilo's own components are written in the bare-attribute grammar, and estilo defines their styling — §Vocabulary | class="rst-*" (right for an app consuming rastrillo's CSS, wrong for a library shipping its own) | Paul, 2026-08-30 | | 5 | The colour engine stays in rastrillo's ui | Moving Pair and allocation here | ui-guidelines-52, 2026-08-30 | | 6 | (Superseded by 8.) Estilo's theme is day, unchanged — not "derived from" or "based on" it. Divergence is allowed but must be driven by a named need, not a preference — §Theme | Restyling on the strength of "day as a base"; changing a token because it "would look better" | Paul, 2026-08-31 | | 7 | Public module, path amadan.net/oficina/estilo.git, licensed MPL-2.0. Anyone can fetch it with plain Git; consumer go.sum files record its integrity. Preserve this path when discovery support changes. The licence grants no rights in the names or marks (MPL-2.0 §2.3). | Staying private with authenticated Git and GOPRIVATE (ruled 2026-09-07); a separately licensed subset copied into Contra; Contra keeping a plain look when self-hosted | Paul, 2026-11-21: publish estilo so Contra, which is MPL-2.0 and self-hostable, can build with the suite's look | | 8 | Estilo's theme is Calma, the suite's own — no longer day. Every app's colour sits on one ring of equal OKLCH lightness (theme/apps.go); each app is themed with its own accent (theme.ForApp). The marks are Calma's (Fanned Oficina mark, app icons with a glow of their own hue) and the suite's ambient effect is a seeded nebula (sky), placed at the sign-in, the team's home and the front page, never inside an app — §Theme | Keeping day "as a base"; one hue per app chosen by eye (Mail and Files would not fit); rim light, cores and motes in the sky | Paul, 2026-09-28/29, after six rounds of design directions: "Calma is by far the best"; "Grain and filaments. No cores, no rim lights. Then go." | | 9 | The chrome is set in the system UI face and downloads no font. --rst-font is system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif (the Modern Font Stacks "System UI" stack, and day's); no estilo stylesheet declares a face. Calma's typography moves from Onest to system UI. The reason: the chrome must never flash (Paul, 2026-10-24: "There should never be a flash of unstyled text. Ever.", invisible text included), and Onest cannot load in WebKit without a frame of invisible text. Measured on fix/chrome-font-no-flash: with font-display: optional and a preload, WebKit paints the page with the chrome text invisible before the fallback; with Onest inlined as a data: URL in a render-blocking stylesheet, native WKWebView still painted the page with no text for 6-16 ms before Onest, in 12 of 12 runs. The system face is resolved during layout, so nothing waits and nothing swaps. v1's font files stay served, byte for byte, for old pages; nothing links them. TestChromeFontIsSystemUI holds it in CI; make test-browser proves it in Chromium and WebKit with pixels — §Theme | Onest with font-display: swap (the flash) or block (invisible, then the same swap); optional with a preload (invisible text in WebKit and Firefox before the fallback); Onest inlined as data: (a frame of invisible text in WebKit, every load, and font-src data: in every CSP); a metric-matched fallback (still a swap); a script gate (the door and the front page run without scripts) | Paul, 2026-10-25, choosing between Onest with a frame of invisible text in Safari and the system face; reviews: GPT-6-Astra (Codex) on aab5e14 | | 10 | The app side panel is estilo's side package, moved from Mapa when Contra became its second consumer: estilo-side-frame (open, rail, or empty for the width to decide) around nav[estilo-side] and <main>, with estilo-side-item, estilo-side-label, estilo-side-key, estilo-side-head, estilo-side-page, estilo-side-foot and the fold. Mapa's values and behaviour, copied, not redesigned; Contra is the second use that corrects it, and Mapa adopts it by renaming | Contra copying Mapa's mapa-side CSS into a second app; designing a side from both apps' specs | Paul, 2026-11-21 |
*Two callers at design time is the bar for extraction. It says nothing about destination.* Both consuming apps were told to propose their primitives to the framework, applied the right bar, and got the wrong answer, because the first question looked like it settled the second. Keep the two apart.
---
Theme — RULED: Calma
> Paul, 2026-08-31, verbatim: "Let's have estilo just be day for > now, but we can add oficina specific changes and components to it as > we need to." > > Paul, 2026-09-28/29, choosing among six rounds of design directions > (~/amadan.net/oficina/design-directions/, published for review at a > temporary site): Calma, "by far the best", with the aurora that became > a nebula; then "Grain and filaments. No cores, no rim lights. Then go."
day was the position estilo held until the suite chose its own look. It has now: estilo's theme is Calma. The "named need" row 6 asked for is Paul's decision to give the suite an identity, recorded as row 8.
What Calma is, and where each part lives:
theme/estilo.css— the suite's tokens: a cool off-white page, white cards, one grey text scale, the system UI face, 12px shapes, a long low shadow, and Oficina's own accent. Status tones areday's, unchanged.theme/apps.go— the ring. Every app has a hue; all share one OKLCH lightness and chroma, so no app is louder than another. The hues are spaced to the eye (34-50°, widest across the muddy yellow-greens), with room for Mail and Files.theme.ForApp(slug)is an app's whole theme: estilo.css, then its accent. The ring is a closed set.- Type is the system UI face (row 9):
--rst-fontin estilo.css, nothing downloaded, so the chrome cannot flash. No webfont in the chrome. Whoever proposes one must first show it renders in WebKit with no invisible frame —make test-browseris the bar, and on 2026-10-25 no loading strategy for Onest passed it.theme/fonts.goonly keeps v1's Onest files answering, byte for byte, for old pages (FontHandleratFontPrefix, both deprecated); link nothing to them. brand/— the marks, generated fromicons.json(hues must equal the ring;brand_testchecks) in web, iPhone and Mac shapes.sky/— the ambient nebula: seeded per team; its colour (haze and clouds) an inline placeholder painted in the first frame, its grain and filaments two static files, no script, still for anyone who asks for less motion. It goes where the suite meets you — the sign-in, the team's home, the front page — and never inside an app. Inside an app, only the icons carry colour.
The gates that replaced TestMatchesDayByteForByte (theme/theme_test.go), and why each exists:
TestDeclaresRastrilloTokens— exactlyday's token names, so rastrillo'stokens.cssnever meets an undefinedvar(--rst-*), and a rastrillo upgrade that adds or drops a token still fails here. Two sources: the pinned v0.23.0'sday, live, and the newest rastrillo an app pins, as a snapshot intheme/testdata/rastrillo-day-tokens.txt(v0.38.0 since 2026-11-20, when Home moved to it; v0.37.0 before). A snapshot, because requiring a newer rastrillo here would pull every app up to it. When an app moves to a newer rastrillo, regenerate the snapshot from that release'sday. The 69 tokens rastrillo added between v0.23.0 and v0.37.0 (Fiesta's fills, controls, tints, switches, type, and depth, light and sheen) are declared at the fallback the snapshot release'stokens.cssuses for each, so rastrillo's own stylesheet draws exactly what it would with none declared. v0.38.0 (Fiesta 1.5.0) declares the same 69 names; the equality was re-checked by script against itstokens.css(everyvar(--rst-…, fallback), by use site), and two had moved: ---rst-focus-edgefalls back to the accent, not--rst-line-strong: Fiesta 1.5.0's one focus ring turns the field's edge to it with the 2px accent outline flush on it. Calma now declaresvar(--rst-accent). Every rastrillo from v0.29.0 to v0.37.0 also reads--rst-focus-edgebut draws its outline 2px off the edge, so under this Calma a focused field shows two accent rings. v0.28.0 and earlier don't read it and are unaffected. ---rst-ghost-face-hoverhas two fallbacks:transparentfor a ghost button's hover,--rst-surface-2for the one-way sign-in door's quiet controls. Calma keepstransparentat:rootand sets--rst-surface-2on the smart door ([estilo-signin-screen], estilo's hook, because the partial'srst-names are rastrillo's). Two consequences, both deliberate: - Inside that screen, every ghost button the partial draws gets the pill on hover, not only the one-way door's. The classic door's "Use a different email" (any rastrillo before v0.38.0, or v0.38.0 withSigninOneWayoff) hovers with a full-widthsurface-2bar where its own fallback istransparent. That's a deviation from "each use site draws its fallback", accepted because no tighter selector exists withoutrst-names. - Outside that screen, the partial's one-way small controls gettransparent: the text still darkens on hover and focus, but there's no pill. Drawing the door throughestilo-signin-screenis the convention that gives the pill; nothing enforces it.
The rule: bump estilo and rastrillo together. An app on rastrillo v0.29.0 to v0.37.0 (on 2026-11-20: Docs v0.29.2, Equipo v0.30.3, Fichas and Mapa v0.35.1) must move to rastrillo v0.38.0 or later in the same change that bumps estilo past this commit. Apps on v0.28.0 or earlier (Sheets, Slides, Calendar, Calls and Memoria, all v0.27.1) read neither token's new fallback and can bump estilo alone. Check an app's pin with git show origin/main:go.mod. Nothing pins the equality, so re-check it whenever the snapshot is regenerated. An app's own CSS can still change if it reads one of these tokens with a different fallback: Fichas' frame.css reads var(--rst-rail-bg, var(--rst-bg)), so its rail turns --rst-surface when it bumps past this commit, unless that line becomes var(--rst-bg) in the same bump. Check each app's CSS for var(--rst-…, …) reads of these tokens when it bumps. Adopting Fiesta's depth and sheen, or any other value for them, is a design decision for Paul like any token change below.
TestContrastMeetsWCAG— every pair rastrillo's own gate checks, in both schemes, for estilo.css and every app's accent, through rastrillo'sui.ContrastRatio(parsing copied verbatim).TestAccentGoldens— each app's accent block againsttestdata/, so no colour moves without a diff that says so.
Changing a value is still a design decision for Paul, not a session's. Change the ring or a token, regenerate the goldens deliberately (go test ./theme -run Goldens -update), read the diff, and record the reason here. "It would look better" is still not a reason on its own; Paul saying so is.
Recorded ring changes. 2026-11-13: Mapa joined at 125 (between Fichas and Sheets; Paul: "more related to Fichas than it is to Memoria or Mail") and Equipo at 322 (between Memoria and Mail; Paul: "Co-ordinator in Pink"), after he reviewed real renders beside the suite. The Oficina mark and the sky gather every hue, so both changed; the sky's Prefix moved to v2 and its goldens were regenerated, while the seed domain (estilo-sky/v1) is unchanged so every team keeps its own sky's shape. 2026-11-19: Equipo's glyph changed from the hub with four specialists and a tick to a chat bubble with two sparkles, the sparkle being the one the Equipo apps draw for the coordinator. Paul chose it from four bubble and sparkle drafts rendered beside Memoria, Mail and Calls: "the sparkle logo is probably the right one". The hue stays 322; the tail points right so it never reads as Calls' bubbles. Equipo joined the native icon set. 2026-11-21: Contra, the suite's password manager, joined at 200 (between Files and Calls; Paul: "Colour seems fine"), with the Safe mark (Paul, after reviewing it in render: "Safe is the most appropriate because that's what this is... it's a vault rather than a key"). As with Mapa and Equipo, the Oficina mark and the sky changed; the sky's Prefix moved to v3 with new goldens, the seed domain unchanged. Contra has no native client, so it is not in the native icon set or distribute.py. The preview sheet now widens with the set; at 12 icons it had already cut off Files and Calls.
---
Dependency — RULED, and check it before adding an import
Rastrillo v0.23.0 supplies the theme and layout APIs Estilo needs. The earlier wait for a release is resolved; this module pins that released version. Estilo is public (row 7): fetch it with plain Git. Consumer go.sum files record its integrity.
The two-pins trap. Estilo pins rastrillo; the apps pin estilo. That is the frozen-tokens.css problem one layer down — a component library carrying stale tokens while its consumers upgrade underneath it. A tokens-drift check ships in the first commit that has code, not after it bites. rastrillo doctor mechanises the single-pin case; this is the two-pin case and it is ours.
---
Vocabulary — attributes here, and why that differs from the apps
Estilo's own components use the bare-attribute grammar (<div rst-inspector>, variants in the value matched with ~=), and estilo ships their styling.
Historical context: Rastrillo v0.23.0 now ships attribute grammar. The following paragraphs record the earlier decision, before that release.
Read this before "correcting" it, because the surrounding conversation has said both things this week and the right answer depends on which repo you are in.
The argument for writing classes is: the attribute grammar exists in no rastrillo tree — verified again at origin/main 7a30456, spec-only, no branch working on it — so a component written in it renders unstyled. That is true for an app leaning on rastrillo's CSS, and false here. Estilo ships its own components and their styling, so styling its own attribute-grammar components is not interim anything; it is permanently estilo's styling. There is nothing to migrate later and no parallel implementation to carry.
And the positive reason, which is the stronger one: estilo is the variant system that exists because of this direction. Birthing it on the spelling being replaced is backwards. Estilo is where the new grammar gets proven, not where it waits.
The three-way split, which holds across the suite:
| Markup | Spelling | Styled by | |---|---|---| | Estilo's own components | Attribute grammar | Estilo | | An app's own markup, using estilo components | Attribute grammar | Estilo | | An app's own markup, using rastrillo's vocabulary | The grammar emitted by the pinned release — attributes in v0.23.0 | rastrillo's tokens.css |
The third row is not our choice and not our migration. It changes when rastrillo changes.
Do not build on .rst-page-header::after — the accent rake line is retired in favour of --rst-header-rule.
Provenance, because this reversed within an hour. docs-e6 first advised classes, reasoning correctly about its own app and then applying the conclusion to a different repo without re-deriving it. Paul challenged it; the correction is his. Recorded with the reasoning rather than the outcome, because the outcome alone reads like an error.
Standards every primitive meets
Inherited from rastrillo's gates, and not negotiable downward:
- Twelve locales. A primitive that only reads in English is unfinished.
- The script-required line stated per primitive. Say plainly what works with scripts off and what does not. "Acceptable for a grid, unacceptable for a form" is the test.
- 24×24 minimum target size, measured on the smaller axis. Do not lean on 2.5.8's spacing exception — a real hit area is honest, and the exception is an argument you have to keep making.
- 320px reflow. Content requiring two-dimensional layout may scroll in both axes; everything else reflows or it is a bug, not an exemption.
- Colour never carries meaning alone. Whatever a colour means must survive greyscale.
- Contrast arithmetic copied verbatim from
ui/contrast_test.go, never reimplemented — two gates disagreeing by a rounding decision is a gate that certifies the wrong thing while passing. - Spacing on the scale (Paul, 2026-11-22: "The spacing is all over the place here... Can we somehow put something in place"). Every margin, padding and gap is
var(--rst-sp-1)tovar(--rst-sp-6), or says why not in a/* spacing-allow: why */comment beside it: geometry, never a preference.make test-spacing(Fiesta's spacing check, run withgo runat a version so estilo never requires Fiesta) is a CI step. Blocks follow Fiesta's stack table (its DESIGN.md, "The stack"), written in estilo's own rules, because an app'stokens.cssmay predaterst-stack: the door's card is one. An app's own card (estilo-door-open) marks a field's hintestilo-signin-hint(0.5rem from its input, either side) and a section of its ownestilo-signin-section(1.5rem above it).
---
The gallery
rastrillo/cmd/dsgen does NOT generate a gallery for an arbitrary module — verified 2026-08-31. Its public surface is -out/-mount, and internal/designsystem.Render hardcodes imports of github.com/carlosframework/rastrillo/ui. It renders rastrillo's own vocabulary. Pointed at estilo it would reproduce rastrillo.org's gallery.
An earlier version of this file claimed the opposite, on good authority that turned out to be wrong. Recorded rather than quietly deleted, because the next person will hear the same claim.
So estilo's gallery is an open question, not a solved one. Do not build a second generator on the strength of that — the right move is probably to ask rastrillo for the seam rather than to fork the tool.
---
Process
Worktree per session, branch per piece of work, regular pushes, squash-merge to main only when the work is done, approved, and CI is actually green — checked, not assumed.
Every spec and every branch is reviewed by the highest-capability model available before approval or merge, and the reviewing model is recorded in the branch discussion. A review nobody can attribute is a review nobody can check.
Every branch gets a discussion, and that discussion is the review record — it survives a squash where a PR body does not. A refusal gets surfaced in the discussion, never routed around.
🤖 / 👨 markers, Co-Authored-By trailers, published prompt ledgers.
Known constraints
Measured facts about Calma's values that bear on the next change.
- The tightest text pair is faint text on an accent-tinted surface: 4.63:1 for Files in dark, against a 4.5:1 floor. Darkening an accent's soft tint or lightening
--rst-text-faintin dark goes under first. - The tightest boundary is a control border on the sunk surface:
--rst-line-strongon--rst-surface-2in light, just over 3:1. - At the accent's lightness some hues cannot hold full chroma in sRGB.
theme.Hextakes chroma down until the colour fits, so hue and lightness stay true (Files' light accent carries about 0.09, not 0.15). An app that looks greyer than its neighbours is this, not a bug. - A strict 40° ring always puts one app in olive or lime at this lightness; that is why the hues are spaced by eye.
TestContrastMeetsWCAG measures all of these on every run; the numbers here are for the conversation before a change, not instead of the test.
Work in a worktree, and catch main up first
Take a worktree for the work. Do not work in the shared checkout.
git -C <repo> fetch origin git -C <repo> worktree add ../<repo>-<task> -b <branch> origin/main
Both halves matter, for different reasons.
The worktree, because several sessions share this machine and some share this repository, and a checkout has one HEAD, one index and one working tree between all of them. A branch switch under somebody else's uncommitted work destroys it with nothing on screen to say so, and two sessions editing the same paths disagree quietly instead of conflicting loudly. A worktree gives the work its own HEAD and its own files, and costs a directory.
From origin/main, after a fetch — not from whatever the checkout happens to be sitting on. A branch cut from a stale main is a merge conflict scheduled for later, against files somebody else has renamed in the meantime. A branch cut from another task's branch is worse: it carries that task's commits into yours, where they are reviewed as though you wrote them, and the two can only be separated by hand.
Remove it when the work has landed — git worktree remove — so that git worktree list keeps saying something true.
Written down because of 2026-09-17, in meet. The shared checkout was sitting on one task's branch while holding a different task's feature uncommitted on disk — some four hundred lines, a new migration among them — put there by a session nobody else knew was working in that tree. Two other sessions were meanwhile coordinating over the same checkout by asking each other not to touch it, which is the arrangement a worktree makes unnecessary. Nothing was lost. Nothing about the arrangement would have said so if it had been, and by then the same feature existed twice, once on each side of a rename, because the two sessions had branched from different starting points.