gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit98a311c098a311c0gate: 390 px checks for list rows, table word, edited tap target, code in titlesmre98a311c0/docs/conventions.md

5.4 KB

  1. # WorldAPI layout conventions
  2. These 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.
  3. ## Formatting
  4. - Indent HTML, PHP, Vidoriel, JavaScript, JSON and CSS with tabs. Do not use spaces for indentation.
  5. - Use spaces where a file format requires them; YAML does not permit tab indentation.
  6. - Keep ordinary CSS declaration blocks on one line.
  7. - Put every selector in a selector group on its own line; keep the declaration block on the final selector's line.
  8. - Use multiline declaration blocks only when a rule is important or genuinely clearer that way.
  9. ```css
  10. button,
  11. .button { display: inline-block; padding: 1rem; }
  12. @media (min-width: 60rem) {
  13. notes > main { display: grid; grid-template-columns: 24rem minmax(0, 1fr); }
  14. }
  15. ```
  16. ## Markup
  17. - Markup describes application meaning; CSS controls layout.
  18. - Prefer domain-specific tags such as `<note-list>`, `<note-reader>`, `<show-title>` and `<application-header>`.
  19. - Do not create `div` soups or generic structures such as `<list-container><list-item>`.
  20. - Use native semantic elements such as `<main>`, `<header>`, `<footer>`, `<nav>` and `<aside>` when their HTML meaning matches the content.
  21. - Do not add a class only to repeat an element's hierarchy. Scope it through the hierarchy when that relationship is stable.
  22. - If an unavoidable generic layout element is needed, prefix it with `layout-`.
  23. - Custom elements intended to be HTML-conforming must contain a hyphen. Names such as `<notes>` and `<note>` need a conforming alternative before publication.
  24. - Classes express visual state or variants, for example `.list`, `.reader`, `.selected` and `.main` when disambiguation is necessary.
  25. - Do not invent custom attributes or use `data-*` for layout state. Use classes, native attributes and ARIA attributes for their defined purposes.
  26. - Do not encode misleading context in control classes. A red button is not necessarily an alert.
  27. ## Responsive behavior
  28. - Write the smallest-screen layout first and add wider behavior with `min-width` media queries.
  29. - Do not put breakpoint classes or responsive layout instructions into markup.
  30. - Let Grid, Flexbox and normal flow handle layout before adding breakpoints.
  31. - A breakpoint belongs in CSS where the content stops working, not in a device-named class.
  32. - Different applications may have different mobile navigation models.
  33. Examples:
  34. - Notes: note list first on mobile; selected note replaces it. Desktop shows list and reader together.
  35. - 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.
  36. - Content-first applications: main content first on mobile; secondary navigation is behind a toggle.
  37. ## CSS architecture
  38. - The base is plain CSS, has no JavaScript dependency and is independent of Vidoriel, React, Vue, Svelte and server rendering.
  39. - Keep foundation, reusable primitives and application layouts separate.
  40. - Keep the existing palette, but expose semantic role tokens to component and layout CSS.
  41. - 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`.
  42. - Do not hardcode palette colors in component or layout files.
  43. - Keep selectors short and unsurprising so lightweight models can trace the cascade.
  44. ```text
  45. css/
  46. ├── foundation/
  47. │ ├── reset.css
  48. │ ├── tokens.css
  49. │ └── base.css
  50. ├── primitives/
  51. └── layouts/
  52. ```
  53. ## Showcase (was: Workbench)
  54. - Since 2026-10-03 (antcolony mission 075) layouts.worldapi.org is a Hybriel app: the WorldAPI theme (`theme/`) and the
  55. showcase that serves it. The Vidoriel SSR workbench (`index.ssr.js`, `.vdrl` fixtures, generic runner) is retired.
  56. - Root: `/elements`, `/components/<name>`, `/shells/<shell>[/<id>]`, `/docs/…` (these files as Markdown).
  57. - The showcase's CSS is the theme itself (no import from `cdn.worldapi.org`); pages are not cached long (hl:web hashed
  58. URLs, `no-cache` on docs).
  59. - Mock data only (`lib/mock.hl`); nothing is stored.
  60. ## Documentation for models
  61. Every shared layout or component must document:
  62. - its purpose;
  63. - expected parent and children;
  64. - allowed classes and states;
  65. - narrow- and wide-screen behavior;
  66. - native and accessibility semantics;
  67. - one complete example;
  68. - one short “do not use for” note when confusion is likely.
  69. Do not rely on conversation memory. Record established decisions here and project-specific behavior beside the fixture.
  70. ## Verification
  71. - Test the rendered result at narrow and wide viewport sizes.
  72. - Exercise each visible state from its trigger through the expected result.
  73. - Test long titles, empty states, overflow, focus and keyboard use.
  74. - Verify public HTML and CSS match the current origin files; a successful `curl` alone does not prove the layout renders correctly.
  75. - Record the exact URLs, commands and observed result in `STATUS.md`.
  76. - A layout is not accepted as working until the user confirms it.
  77. ## Open decisions
  78. - Final palette values, contrast targets and light-theme behavior.
  79. - Exact breakpoint values for each layout.
  80. - Final names for top-level application elements that currently lack the hyphen required by conforming custom-element names.
  81. - Published CDN version paths and compatibility policy.
  82. - Whether page-level `<header>` and `<footer>` need `.main` when hierarchy already identifies them.

Branches

Latest commits

  • 98a311c0gate: 390 px checks for list rows, table word, edited tap target, code in titlesmre
  • 769b99d7theme: table cells keep a word whole, code in a title stays text-sized, 'edited' is a 44 px tap target on the phonemre
  • c36b7595list rows (notes, mail) stack their parts full width: the date no longer a one-letter column beside the titlemre
  • 02aa74aasync components.hybriel 134b4e3: MdEditor builds an editor put into the page at once, redraws a surface put in anew (F5, hybriel#211)mre
  • 268b1c87sync components.hybriel 6b0936a: the 'edited' foldable drops the theme's border and marginmre
  • c51d039fsync components.hybriel 8d79ff7: bubble hugs its content, quiet 'edited' label; gate checksmre
  • f4ad7eecsync components 9a: shared Icon (icons/icons.hl), md-editor toolbar icons + single focus ring (components f4-icons ba96735)mre
  • db258c11sync-components: copy icons/icons.hl + README (F4); testsmre
  • badc1879md-editor.hl: verbatim copy of components f3-mdvalue (an older text handed back is kept)mre
  • 867a8375md-editor.hl: verbatim copy of components f3-mdvalue (an outside value change is shown by the editor)mre
  • 5d8d2c67tests: wait for hydration before real clicks after a navigation (H2)mre
  • 99db79f0re-vendor Hybriel 5406d146 (hl:web batches 9+10: #72 emits while the socket is closed delivered after reconnect, browser boot linear, faster list appends; contains int 6–14 + m406)mre
  • 30353f60tests: e2e-md-showcase Chrome range from LAYOUTS_GATE_CHROME_MD, default unchangedmre
  • 16a7878cre-vendor Hybriel 6f8a0689 (int 6–11: streaming cursors, #203 index heal + close() fix, fd403 listDir/cursor fds, hl:time browser side, hl:web batches 5+6)mre
  • 6af559e8docker-compose: nofile 65536 (Hybriel int 6+ boot opened >1024 files in the tracker)mre
  • 5599cf56deploy: backup copies index files first and *.mpack data last (hot-copy skew, hybriel #203)mre
  • 0bcc6294Mission 011: e2e-197, brief, report, LOGmre
  • 137303c5MainMenu marks the current page from the route (hybriel#197, server-rendered); current prop/item.current stay as fallback; tracker demo drops current; gate: SSR marker; docsmre
  • 9325b403Re-vendor Hybriel to master 7f13a82f (hl:web batch 2: #190 #193 #197 #194 named regions); plugins whole, bin/hybriel static build (git-ignored)mre
  • b31dc74dusage: calendar (theme 76f99f6-era ContentFirst, user menu, ☰ menu) and tracker (theme 76f99f6, modal + pagination current, own current marker until hybriel#197) rowsmre