| 1 | # Estilo |
| 2 | |
| 3 | Estilo is the CARLOS suite's shared design system, at |
| 4 | `amadan.net/oficina/estilo.git`. It's a public Go module under the |
| 5 | Mozilla Public License 2.0 (`LICENSE`). |
| 6 | |
| 7 | `theme` is Calma, the suite's look (AGENTS.md, "Theme"): `theme.CSS()` is |
| 8 | the suite's theme and `theme.ForApp(slug)` an app's, with its accent from |
| 9 | the colour ring in `theme/apps.go`. The chrome is set in |
| 10 | the system UI face and downloads no font (AGENTS.md row 9); |
| 11 | `theme.FontHandler` only keeps the retired Onest files of `fonts/v1/` |
| 12 | answering for old pages, and nothing should link them. `brand` holds the marks, |
| 13 | and `sky` the seeded nebula for the sign-in, the team's home and the front |
| 14 | page — never inside an app. |
| 15 | |
| 16 | `savestatus` is a save-status indicator, already adopted by Docs and |
| 17 | Slides. It renders state (saved, saving, retrying, failed) inside a |
| 18 | polite status region for screen readers; callers supply the localized |
| 19 | message text for each state. |
| 20 | |
| 21 | `homeconnect` holds templates and data for Home account-connection and |
| 22 | OAuth screens, being adopted by the shared home/connect flow and other |
| 23 | apps. It carries no authentication logic — callers validate the |
| 24 | destination and supply translated labels. The screens run without |
| 25 | scripts. |
| 26 | |
| 27 | `base`, `menu` and `chrome` are the shared chrome from the round-2 spec |
| 28 | (`docs/superpowers/specs/2026-09-23-shared-chrome.md` on |
| 29 | `spec/shared-chrome`): link styling; the one floating menu panel and the |
| 30 | document menu bar, with `menu.Shortcut` for platform-correct shortcut |
| 31 | labels; and the top bar, account menu, app switcher, error page and |
| 32 | sign-in pages, with the per-app Appearance preference. Link the three |
| 33 | stylesheets in that order, after `tokens.css`, the theme and |
| 34 | `brand.css`. `brand` serves the app icons from Go. Docs adopted first and |
| 35 | Sheets second, and Sheets' corrections are in: a menu row or bar action |
| 36 | can be a link, a POST (`menu.Item.Action`) or a dialog opened by the |
| 37 | platform's invoker command (`menu.Item.Dialog`); `Bar.Actions` is |
| 38 | `[]chrome.Action`; `<div estilo-shell="fill">` is the full-height layout |
| 39 | (the viewport less the 52px bar); and `chrome.js` closes every member of |
| 40 | the one `estilo-menus` group, menubar menus included, on Escape (in the |
| 41 | capture phase) and an outside click. |
| 42 | |
| 43 | Docs' I2 editor added two slots to `chrome.Bar` (spec |
| 44 | `docs/superpowers/specs/2026-11-11-editor-i2-design.md` in Docs). |
| 45 | `Menubar` takes the app's own `estilo-menubar` markup and makes the bar |
| 46 | stacked (`estilo-bar~="stacked"`): from 800px a 56px header with the title |
| 47 | over the menus, below it the one-row bar with the menus as a second row; |
| 48 | `--estilo-bar-block-size` is published either way. `Lead` takes app markup |
| 49 | for the start of the end group (Docs' undo/redo), which the app must hide |
| 50 | on narrow screens itself. A bar with either slot |
| 51 | draws its end group as one set of controls; a bar with neither is |
| 52 | unchanged, byte for byte. `Action.WideOnly` hides an action below 64rem |
| 53 | and keeps it out of the Menu sheet, and `menu.Item.Controls` is a toggle |
| 54 | (`aria-expanded`, `aria-controls`, disabled until the app binds it). The |
| 55 | account menu's Appearance is a three-way segmented selector that |
| 56 | `chrome.js` switches in place. |
| 57 | |
| 58 | Docs' phone web design (Paul, 2026-11-28) added `Bar.Compact` |
| 59 | (`estilo-bar~="compact"`): below 704px, or on a phone held sideways, the |
| 60 | bar is one 52px row of Back (the brand: a chevron and the app's name), |
| 61 | the title, the lead and the app's `Compact.Trail` (Docs' Aa and •••); the |
| 62 | menu row, the actions, the switcher and the account are not shown there, |
| 63 | and the Menu sheet is drawn only for `Nav`. From 704px a compact stacked |
| 64 | bar is the 56px header, which every other stacked bar keeps from 800px |
| 65 | (Mapa's and Fichas' layouts change there); the 704px band is a copy of |
| 66 | the header's rules that `CSS()` makes, scoped to a compact bar. `Compact.Title` replaces |
| 67 | the bar's title for a page with a large title of its own: it shows once |
| 68 | the app's script sets `estilo-bar-folded` on the header. In the trail, |
| 69 | `[estilo-bar-tool]` is a 44px round control and a `<details>` panel is a |
| 70 | drop-down from the bar's inline end with 44px rows. `menu.Item.Icon` |
| 71 | draws a glyph before a row's label. On a coarse pointer, in every app, |
| 72 | the bar's triggers, the rail's account row, every menu row and every |
| 73 | menubar title are 44px, and where nothing hovers |
| 74 | menus show no shortcut hints. `savestatus` takes a third placement, |
| 75 | `subtitle`, for the state under a large title. |
| 76 | |
| 77 | The smart door (spec `docs/superpowers/specs/2026-11-19-smart-door.md` in |
| 78 | Home, step 2) is `estilo-signin-screen` with `chrome.SignInScreen`: |
| 79 | rastrillo's sign-in screen, its ui `signin` partial (the remembered way |
| 80 | in, Other ways to sign in and the chooser), drawn inside the door, with |
| 81 | the sky behind and the app's mark and name at the card's head. It is |
| 82 | duck-typed, because estilo pins the old rastrillo path: the app passes its |
| 83 | `auth.SigninState` and `*ui.Localizer` as `State` and `L`, and parses its |
| 84 | own rastrillo's `ui.Templates()` alongside estilo's. With |
| 85 | `State.Unavailable` it draws nothing. `chrome.OficinaGlyph` is the icon for |
| 86 | the Oficina ID door (`auth.FederatedDoor.Icon`), and |
| 87 | `SignInNotice.Forgetting` adds "Forget me on this device" to the |
| 88 | signed-out page. `estilo-signin` stays for apps that haven't moved; the |
| 89 | door carries no footer links. |
| 90 | |
| 91 | `desk` is the grey desk an editor sits on (`--estilo-desk`), the floating |
| 92 | glass card (`estilo-card`), the inspector built on it (`estilo-inspector`, |
| 93 | with `estilo-inspector-group` and `estilo-inspector-label`) and the |
| 94 | segmented control (`estilo-seg`, `estilo-seg-item`: a button with |
| 95 | `aria-pressed`, or a label around a radio or checkbox). The values are |
| 96 | Docs' own, copied; Slides is the first other app to use them. It is styling |
| 97 | only, so it works with scripts off; the app places the card. |
| 98 | |
| 99 | `side` is an app's side panel, Mapa's, moved here when Contra became |
| 100 | its second user. `<div estilo-side-frame>` puts `nav[estilo-side]` under |
| 101 | the bar, beside `<main>`; its rows are `estilo-side-item` (an icon, |
| 102 | `estilo-side-label`, an optional `kbd[estilo-side-key]`), page rows sit |
| 103 | under `estilo-side-head` headings, and `estilo-side-foot` is pinned to |
| 104 | the bottom with the fold. The fold turns the side into a rail of icons, |
| 105 | with the labels as tooltips: from 80rem it is open unless folded, below |
| 106 | that a rail, and below 800px it is gone, because its places are in the |
| 107 | bar's Menu sheet. The fold is a form, so it works with scripts off |
| 108 | (`side.SetState` keeps it in the app's cookie); `side.js` folds in place |
| 109 | and adds ⌘\. Link `side.css` after `chrome.css`. |
| 110 | |
| 111 | `colophon` is the suite's Colophon, reached from Help: every open-source |
| 112 | project an app is made with, in sections (typefaces, libraries by |
| 113 | runtime, icons and artwork, data, tools), each with a sentence or two on |
| 114 | what it is and what the app uses it for, who made it, its licence (linked |
| 115 | to the text the app serves) and its home and source. `projects.json` is |
| 116 | the one catalog of those words, so every app describes Yjs the same way. |
| 117 | An app never lists projects by hand: it collects what it ships (Go |
| 118 | modules through `credits/catalog`, npm packages from esbuild's metafile |
| 119 | with `CollectNPM`, crates from `cargo metadata` with `CollectCargo`, plus |
| 120 | its fonts and vendored files) and `colophon.Build` refuses a package the |
| 121 | catalog does not know, a usage note for something no longer shipped, or a |
| 122 | shipped package without its licence text. No script, no webfont. Docs |
| 123 | adopted first. |
| 124 | |
| 125 | Permission and session logic stay app-owned. There is no |
| 126 | shared component gallery yet. |
| 127 | |
| 128 | ## Building |
| 129 | |
| 130 | `make test` is the gate: a module-cache check (`go mod verify`, re-fetching |
| 131 | anything damaged), `go vet`, a `gofmt` check, `go build`, then `go test`. `savestatus`'s own tests run under Node. |
| 132 | |
| 133 | ## Licence |
| 134 | |
| 135 | Estilo is licensed under the Mozilla Public License 2.0; see `LICENSE`. |
| 136 | The licence covers the code, styles and artwork in this repository. It |
| 137 | does not grant rights in the Oficina, CARLOS or app names, or permission |
| 138 | to present a modified build as the suite (MPL-2.0 section 2.3). |
| 139 | Third-party parts keep their own licences: Lucide (`brand/LICENSE.lucide`) |
| 140 | and Onest (`credits/notices/onest-OFL.txt`). |
| 141 | |