layouts
All repositories: gitoria
5.4 KB
# WorldAPI layout conventionsThese are requirements for the shared WorldAPI CSS and the layout workbench. Examples are intentionally small so lightweight models can follow them without reconstructing design intent.## Formatting- Indent HTML, PHP, Vidoriel, JavaScript, JSON and CSS with tabs. Do not use spaces for indentation.- Use spaces where a file format requires them; YAML does not permit tab indentation.- Keep ordinary CSS declaration blocks on one line.- Put every selector in a selector group on its own line; keep the declaration block on the final selector's line.- Use multiline declaration blocks only when a rule is important or genuinely clearer that way.```cssbutton,.button { display: inline-block; padding: 1rem; }@media (min-width: 60rem) {notes > main { display: grid; grid-template-columns: 24rem minmax(0, 1fr); }}```## Markup- Markup describes application meaning; CSS controls layout.- Prefer domain-specific tags such as `<note-list>`, `<note-reader>`, `<show-title>` and `<application-header>`.- Do not create `div` soups or generic structures such as `<list-container><list-item>`.- Use native semantic elements such as `<main>`, `<header>`, `<footer>`, `<nav>` and `<aside>` when their HTML meaning matches the content.- Do not add a class only to repeat an element's hierarchy. Scope it through the hierarchy when that relationship is stable.- If an unavoidable generic layout element is needed, prefix it with `layout-`.- Custom elements intended to be HTML-conforming must contain a hyphen. Names such as `<notes>` and `<note>` need a conforming alternative before publication.- Classes express visual state or variants, for example `.list`, `.reader`, `.selected` and `.main` when disambiguation is necessary.- Do not invent custom attributes or use `data-*` for layout state. Use classes, native attributes and ARIA attributes for their defined purposes.- Do not encode misleading context in control classes. A red button is not necessarily an alert.## Responsive behavior- Write the smallest-screen layout first and add wider behavior with `min-width` media queries.- Do not put breakpoint classes or responsive layout instructions into markup.- Let Grid, Flexbox and normal flow handle layout before adding breakpoints.- A breakpoint belongs in CSS where the content stops working, not in a device-named class.- Different applications may have different mobile navigation models.Examples:- Notes: note list first on mobile; selected note replaces it. Desktop shows list and reader together.- Landroval: message list first on mobile; mailbox list is behind a toggle; selecting a message opens the reader. Desktop shows mailboxes, messages and reader together.- Content-first applications: main content first on mobile; secondary navigation is behind a toggle.## CSS architecture- The base is plain CSS, has no JavaScript dependency and is independent of Vidoriel, React, Vue, Svelte and server rendering.- Keep foundation, reusable primitives and application layouts separate.- Keep the existing palette, but expose semantic role tokens to component and layout CSS.- Raw palette values belong only in the token source. Components use semantic tokens such as `--color-background`, `--color-text`, `--color-border`, `--color-action` and `--color-danger`.- Do not hardcode palette colors in component or layout files.- Keep selectors short and unsurprising so lightweight models can trace the cascade.```textcss/├── foundation/│ ├── reset.css│ ├── tokens.css│ └── base.css├── primitives/└── layouts/```## Showcase (was: Workbench)- Since 2026-10-03 (antcolony mission 075) layouts.worldapi.org is a Hybriel app: the WorldAPI theme (`theme/`) and theshowcase that serves it. The Vidoriel SSR workbench (`index.ssr.js`, `.vdrl` fixtures, generic runner) is retired.- Root: `/elements`, `/components/<name>`, `/shells/<shell>[/<id>]`, `/docs/…` (these files as Markdown).- The showcase's CSS is the theme itself (no import from `cdn.worldapi.org`); pages are not cached long (hl:web hashedURLs, `no-cache` on docs).- Mock data only (`lib/mock.hl`); nothing is stored.## Documentation for modelsEvery shared layout or component must document:- its purpose;- expected parent and children;- allowed classes and states;- narrow- and wide-screen behavior;- native and accessibility semantics;- one complete example;- one short “do not use for” note when confusion is likely.Do not rely on conversation memory. Record established decisions here and project-specific behavior beside the fixture.## Verification- Test the rendered result at narrow and wide viewport sizes.- Exercise each visible state from its trigger through the expected result.- Test long titles, empty states, overflow, focus and keyboard use.- Verify public HTML and CSS match the current origin files; a successful `curl` alone does not prove the layout renders correctly.- Record the exact URLs, commands and observed result in `STATUS.md`.- A layout is not accepted as working until the user confirms it.## Open decisions- Final palette values, contrast targets and light-theme behavior.- Exact breakpoint values for each layout.- Final names for top-level application elements that currently lack the hyphen required by conforming custom-element names.- Published CDN version paths and compatibility policy.- Whether page-level `<header>` and `<footer>` need `.main` when hierarchy already identifies them.
Branches
Latest commits
- a56abf1fSync components to components.hybriel 3794c59 (MdEditor real-key fixes); showcase real-key check on the md-editor pagemre
- 76f99f64E2E in lisbeth's Chrome for the menu's current page (mission 009): tests/e2e-menu-current.mjs, reportmre
- 159b1d53MainMenu/Sidebar: current page marked beyond colour, count badge, item current flag; gate 300/0 (mission 009)mre
- 0573eed3usage: notes + tickets on MdEditor (md-editor.js retired), gitoria on theme dbe3de7, tracker theme oldermre
- 78478f6eSync showcase to components.hybriel 1442e58: pick-mode page, comments attach, md-editor rows/files off; gates 285/0mre
- dbe3de79Display bugs from a real Chrome walk (mission 007): Settings page and in-shell doc reader instead of raw .md links, closed phone search hidden whatever a page says, /elements form rules scoped, three-pane danger contrast; display audit gate (132 -> 244 checks), walk + Settings e2e toolsmre
- 1875a051Theme: 44 px tap targets mobile first (layoutTap), 16 px fields, desktop denser only in @media 60rem; 390 px tap audit + gate checks (mission 006)mre
- 3d4f8e19Sync showcase to components.hybriel 9db927d: comments and files-upload pages, pagination onPage, md-editor readonly, gate 99 checksmre
- 64d635acmission brief 005mre
- 0d0fef25paths: projects moved into /media/STORAGE/projects/WorldAPI/mre
- 2dbe0df5Re-vendor Hybriel to the shared static build 0f396652 (plugins; bin/ is git-ignored), compose cache volume + tmpfs /tmp, gate wait 120 s, report 004mre
- 0adc551emission brief 004mre
- 1376e905deploy.sh: wait up to DEPLOY_URL_WAIT (120 s) for 200 after the restart, as the other apps (cold compile, hybriel#148)mre
- c0fdbf6cdocker-compose: init: true (hybriel#156, PID 1 ignored SIGTERM, every restart waited 10 s)mre
- ecf70665usage: layouts on components a567b57mre
- 315731efcomponents re-synced to components.hybriel a567b57 (md-editor tables)mre
- b59e2ee9docs/usage.md + tools/usage.sh: which app carries which component/theme/tokens copy, and whether it matches the sourcemre
- 0222f67ctheme: two corner radii only (radiusSmall 5px, radiusLarge 10px); check-theme flags any other radius; gate 76/0mre
- 877b63acdesign rules: two radii only (5px small, 10px large)mre
- 635234dfcomponents re-synced to components.hybriel 5a98d77 (#15 black/white base look); gate 73/0, check-theme 0, screenshots unchangedmre