gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit7f992d627f992d62gitoria#23: phone first on the shared theme — brand, branch and pull links 44 px, readme code 14 px; gate block "phone first" (15 pages at 390 + the three dropdowns, fails 20 on old), dropdown-aware login/logout clicks, check-theme in GATESmre7f992d62/theme/theme.hl

14.7 KB

  1. // theme/theme.hl — THE WORLDAPI THEME: how WorldAPI makes the black/white components of components.hybriel.worldapi.org
  2. // look for itself. A styles file (hl:web): an app inherits it from its own styles.hl and sets its accent and type colours:
  3. //
  4. // inherit './theme/theme.hl'
  5. // import { var } from 'hl:web/css'
  6. // import { purple, yellow } from './shared/tokens.hl'
  7. // colorAccent = var(purple)
  8. // colorType1 = var(yellow)
  9. //
  10. // What is in here, in this order:
  11. // 1. layout tokens and the type-colour slots (the palette and the semantic roles are shared/tokens.hl)
  12. // 2. plain HTML elements: text, links, buttons, fields, foldables, drop zones, tables, pills
  13. // 3. the components of components.hybriel.worldapi.org, themed WITHOUT forking them: every rule repeats the component's
  14. // own selector with `html ` in front, so it wins over the component's Style (which comes later in the one stylesheet)
  15. // and never emits the same selector twice (hl:web refuses that)
  16. // The shells (header, sidebar, content-first, list-first, three-pane) carry their own Style in theme/shell/*.hl.
  17. //
  18. // Design rules (docs/design-rules.md): borderless — a border only where it means something (foldables, drop zones,
  19. // focus); no boxed cards, no grey frames; colours only through the named tokens; titles white; mobile first, wider
  20. // layouts in `@media (min-width: 60rem)` (the one breakpoint of the theme, also used by theme/shell/*.hl).
  21. import { var } from 'hl:web/css'
  22. import { yellow, greenDark, purple, blueDark, orange, blueLight, colorBackground, colorBackgroundSunken, colorSurface, colorBorder, colorText, colorTextStrong, colorTextMuted, colorSuccess, colorWarning, colorDanger, colorAccent, colorAccentText } from '../shared/tokens.hl'
  23. // ---- 1. tokens -------------------------------------------------------------------------------------------------
  24. // the type colours: an app names what each slot means (tracker: 1 Movie, 2 Series, 3 Show, 4 Genre, 5 Person) and may
  25. // point a slot at another palette colour in its styles.hl (`colorType1 = var(yellow)`)
  26. colorType1 = var(yellow)
  27. colorType2 = var(greenDark)
  28. colorType3 = var(purple)
  29. colorType4 = var(blueDark)
  30. colorType5 = var(orange)
  31. colorType6 = var(blueLight)
  32. // the layout: the centred content column (header contents end flush with it), the side gutter, the header height, the
  33. // sidebar and list-pane widths of the shells
  34. layoutColumn = var('72rem')
  35. layoutGutter = var('1rem')
  36. layoutHeader = var('3.25rem')
  37. layoutSidebar = var('16rem')
  38. layoutList = var('24rem')
  39. // the corner radii — exactly two (docs/design-rules.md "Corner radius"): radiusSmall for every small item (buttons, pills,
  40. // fields, tags, menu items, chips, day cells), radiusLarge for everything else that is rounded (panels, modals, popovers,
  41. // dropdowns, foldables, tiles/posters); '50%' only for round things (avatars, the check circle). check-theme flags any other
  42. radiusSmall = var('5px')
  43. radiusLarge = var('10px')
  44. // ---- 2. plain elements -----------------------------------------------------------------------------------------
  45. '*,
  46. *::before,
  47. *::after' { boxSizing = 'border-box' }
  48. html { colorScheme = 'dark' scrollbarColor = colorBorder + ' transparent' }
  49. body { margin = '0' minHeight = '100dvh' font = '16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif' color = colorText background = colorBackground overflowWrap = 'anywhere' }
  50. '::selection' { color = colorAccentText background = colorAccent }
  51. '[hidden]' { display = 'none !important' }
  52. h1 { margin = '0 0 1rem' fontSize = '1.6rem' lineHeight = '1.25' color = colorTextStrong }
  53. h2 { margin = '1.5rem 0 .6rem' fontSize = '1.25rem' lineHeight = '1.3' color = colorTextStrong }
  54. h3 { margin = '1.25rem 0 .5rem' fontSize = '1.05rem' lineHeight = '1.3' color = colorTextStrong }
  55. h4 { margin = '1rem 0 .4rem' fontSize = '1rem' color = colorTextStrong }
  56. p { margin = '0 0 1rem' }
  57. strong { color = colorTextStrong }
  58. small { fontSize = '.85rem' }
  59. '.muted' { color = colorTextMuted }
  60. 'p.empty' { color = colorTextMuted fontStyle = 'italic' }
  61. '.visually-hidden' { position = 'absolute' width = '1px' height = '1px' margin = '-1px' padding = '0' overflow = 'hidden' clip = 'rect(0 0 0 0)' whiteSpace = 'nowrap' border = '0' }
  62. ul { margin = '0 0 1rem' paddingLeft = '1.25rem' }
  63. ol { margin = '0 0 1rem' paddingLeft = '1.5rem' }
  64. li { margin = '.15rem 0' }
  65. hr { height = '1px' margin = '1.5rem 0' border = '0' background = colorSurface }
  66. img { maxWidth = '100%' height = 'auto' }
  67. a { color = colorAccent textDecoration = 'none' textUnderlineOffset = '.2em' }
  68. 'a:hover' { textDecoration = 'underline' }
  69. ':focus-visible' { outline = '2px solid ' + colorAccent outlineOffset = '2px' }
  70. 'code,
  71. kbd,
  72. samp' { padding = '.05rem .3rem' font = '.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace' background = colorSurface borderRadius = radiusSmall }
  73. pre { margin = '0 0 1rem' padding = '.75rem 1rem' overflow = 'auto' font = '.9rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace' background = colorBackgroundSunken borderRadius = radiusLarge }
  74. 'pre code' { padding = '0' background = 'transparent' }
  75. // buttons: quiet by default (text on nothing, a surface on hover); `.primary` (and a form's submit) is the accent;
  76. // `.danger` says it destroys something — never decoration
  77. 'button,
  78. .button' { display = 'inline-flex' alignItems = 'center' justifyContent = 'center' gap = '.4rem' minHeight = '2.25rem' padding = '.4rem .9rem' font = 'inherit' fontWeight = '600' lineHeight = '1.2' color = colorText textDecoration = 'none' background = 'transparent' border = '0' borderRadius = radiusSmall cursor = 'pointer' }
  79. 'button:hover,
  80. .button:hover' { textDecoration = 'none' background = colorSurface }
  81. 'button.primary,
  82. .button.primary,
  83. button[type="submit"]' { color = colorAccentText background = colorAccent }
  84. 'button.primary:hover,
  85. .button.primary:hover,
  86. button[type="submit"]:hover' { background = colorAccent filter = 'brightness(1.1)' }
  87. 'button.danger,
  88. .button.danger' { color = colorDanger }
  89. 'button:disabled' { opacity = '.45' cursor = 'default' filter = 'none' }
  90. 'button svg,
  91. .button svg' { flex = 'none' width = '1.25rem' height = '1.25rem' }
  92. // fields: a sunken surface, no frame; the focus ring is the accent; an invalid field gets the danger ring
  93. label { display = 'block' marginBottom = '.25rem' fontWeight = '600' color = colorTextStrong }
  94. 'input,
  95. select,
  96. textarea' { maxWidth = '100%' padding = '.5rem .7rem' font = 'inherit' color = colorText background = colorBackgroundSunken border = '0' borderRadius = radiusSmall }
  97. 'input:focus,
  98. select:focus,
  99. textarea:focus' { outline = '2px solid ' + colorAccent outlineOffset = '0' }
  100. 'input[aria-invalid="true"],
  101. textarea[aria-invalid="true"]' { outline = '2px solid ' + colorDanger outlineOffset = '0' }
  102. 'input[type="checkbox"],
  103. input[type="radio"]' { width = '1.1rem' height = '1.1rem' padding = '0' accentColor = colorAccent }
  104. 'input::placeholder,
  105. textarea::placeholder' { color = colorTextMuted }
  106. textarea { width = '100%' minHeight = '6rem' resize = 'vertical' }
  107. fieldset { margin = '0 0 1rem' padding = '0' border = '0' }
  108. legend { padding = '0' marginBottom = '.5rem' fontWeight = '600' color = colorTextStrong }
  109. 'form p' { margin = '0 0 1rem' }
  110. progress { accentColor = colorAccent }
  111. // FOLDABLES: the border belongs to the foldable (the creator likes it on the tracker's season collapsibles)
  112. details { margin = '0 0 .75rem' border = '1px solid ' + colorBorder borderRadius = radiusLarge }
  113. summary { padding = '.6rem .9rem' fontWeight = '600' color = colorTextStrong cursor = 'pointer' }
  114. 'summary:hover' { background = colorSurface }
  115. 'details[open] > summary' { borderBottom = '1px solid ' + colorBorder }
  116. 'details > :not(summary)' { marginLeft = '.9rem' marginRight = '.9rem' }
  117. 'details > summary + *' { marginTop = '.75rem' }
  118. 'details > :last-child:not(summary)' { marginBottom = '.75rem' }
  119. // DROP ZONES: a dashed border says "drop here"; `.over` while something is dragged over it
  120. 'drop-zone,
  121. .drop-zone' { display = 'block' padding = '1.25rem' textAlign = 'center' color = colorTextMuted border = '2px dashed ' + colorBorder borderRadius = radiusLarge }
  122. 'drop-zone.over,
  123. .drop-zone.over' { color = colorText borderColor = colorAccent background = colorSurface }
  124. // tables: no grid; the header row is muted, a row lights up under the pointer
  125. table { width = '100%' margin = '0 0 1rem' borderCollapse = 'collapse' }
  126. th { padding = '.4rem .6rem' fontSize = '.85rem' fontWeight = '600' textAlign = 'left' color = colorTextMuted }
  127. td { padding = '.5rem .6rem' verticalAlign = 'top' }
  128. 'tbody tr:nth-child(odd)' { background = colorBackgroundSunken }
  129. 'tbody tr:hover' { background = colorSurface }
  130. // type colours and pills: `class="type-2"` colours a text with its slot; `.pill` turns it into an inverted label (text on
  131. // the colour); a pill without a type is the accent. Status words use the semantic roles: `.success`, `.warning`, `.danger`
  132. '.type-1' { color = colorType1 }
  133. '.type-2' { color = colorType2 }
  134. '.type-3' { color = colorType3 }
  135. '.type-4' { color = colorType4 }
  136. '.type-5' { color = colorType5 }
  137. '.type-6' { color = colorType6 }
  138. '.success' { color = colorSuccess }
  139. '.warning' { color = colorWarning }
  140. '.danger' { color = colorDanger }
  141. '.pill' { display = 'inline-block' padding = '.1rem .55rem' fontSize = '.8rem' fontWeight = '700' lineHeight = '1.5' color = colorAccentText background = colorAccent borderRadius = radiusSmall whiteSpace = 'nowrap' }
  142. '.pill.type-1' { color = colorAccentText background = colorType1 }
  143. '.pill.type-2' { color = colorAccentText background = colorType2 }
  144. '.pill.type-3' { color = colorAccentText background = colorType3 }
  145. '.pill.type-4' { color = colorAccentText background = colorType4 }
  146. '.pill.type-5' { color = colorAccentText background = colorType5 }
  147. '.pill.type-6' { color = colorAccentText background = colorType6 }
  148. '.pill.success' { color = colorAccentText background = colorSuccess }
  149. '.pill.warning' { color = colorAccentText background = colorWarning }
  150. '.pill.danger' { color = colorAccentText background = colorDanger }
  151. '.pill.quiet' { color = colorText background = colorSurface }
  152. // ---- 3. the components of components.hybriel.worldapi.org --------------------------------------------------------
  153. // Their own Style draws frames around buttons, fields, editors and day cells. The theme takes the decorative ones away
  154. // (the drop zone's dashed border and the focus rings stay — they mean something) and lets surfaces separate instead.
  155. // Their corners become the theme's two radii: small items radiusSmall, popups / windows / editors / day tiles radiusLarge.
  156. // pagination
  157. 'html pagination button' { border = '0' borderRadius = radiusSmall }
  158. 'html pagination li.current button' { border = '0' }
  159. // modal: the dimmed page around the window is the separation
  160. 'html modal-dialog > dialog' { background = colorSurface border = '0' borderRadius = radiusLarge boxShadow = '0 1rem 3rem ' + colorBackgroundSunken }
  161. 'html modal-dialog header' { borderBottom = '0' }
  162. 'html modal-dialog modal-body footer' { background = colorSurface borderTop = '0' }
  163. 'html modal-dialog button' { borderRadius = radiusSmall }
  164. 'html modal-dialog button:hover' { background = colorBackground }
  165. // month view: the day cells are tiles with a gap, no grid lines
  166. 'html month-view ol' { gap = '.25rem' }
  167. 'html month-view button' { border = '0' borderRadius = radiusSmall }
  168. 'html #month-days li' { border = '0' borderRadius = radiusLarge }
  169. // date picker + date range picker: borderless field, the popup is a raised surface
  170. 'html date-picker input' { border = '0' borderRadius = radiusSmall }
  171. 'html range-picker input' { border = '0' borderRadius = radiusSmall }
  172. 'html date-picker input[aria-invalid="true"]' { outline = '2px solid ' + colorDanger outlineOffset = '-2px' }
  173. 'html range-picker input[aria-invalid="true"]' { outline = '2px solid ' + colorDanger outlineOffset = '-2px' }
  174. 'html date-picker month-view' { background = colorSurface border = '0' borderRadius = radiusLarge boxShadow = '0 .75rem 2rem ' + colorBackgroundSunken }
  175. 'html range-picker month-view' { background = colorSurface border = '0' borderRadius = radiusLarge boxShadow = '0 .75rem 2rem ' + colorBackgroundSunken }
  176. 'html date-picker button' { border = '0' borderRadius = radiusSmall }
  177. 'html range-picker button' { border = '0' borderRadius = radiusSmall }
  178. 'html date-picker month-view ol' { gap = '.2rem' }
  179. 'html range-picker month-view ol' { gap = '.2rem' }
  180. 'html date-picker ol.days li' { background = colorBackground border = '0' borderRadius = radiusSmall }
  181. 'html range-picker ol.days li' { background = colorBackground border = '0' borderRadius = radiusSmall }
  182. 'html date-picker ol.days li.outside' { background = 'transparent' }
  183. 'html range-picker ol.days li.outside' { background = 'transparent' }
  184. 'html date-picker ol.days li.selected' { background = colorAccent }
  185. 'html range-picker ol.days li.selected' { background = colorAccent }
  186. 'html range-picker ol.days li.between' { background = colorBackgroundSunken outline = '0' }
  187. 'html range-picker ol.days li.between time' { color = colorAccent }
  188. // file upload: the drop zone keeps its dashed border (it is a drop zone); the choose button is a plain button
  189. 'html file-upload drop-zone' { borderRadius = radiusLarge }
  190. 'html file-upload label.choose' { fontWeight = '600' border = '0' borderRadius = radiusSmall }
  191. 'html file-upload label.choose:hover' { color = colorTextStrong filter = 'brightness(1.15)' }
  192. // file upload, several files: the same (the component's own radii are .5rem and .35rem)
  193. 'html files-upload drop-zone' { borderRadius = radiusLarge }
  194. 'html files-upload label.choose' { fontWeight = '600' border = '0' borderRadius = radiusSmall }
  195. 'html files-upload label.choose:hover' { color = colorTextStrong filter = 'brightness(1.15)' }
  196. // Markdown editor: one sunken surface, the toolbar a surface strip; no lines between the parts
  197. 'html md-editor' { border = '0' borderRadius = radiusLarge }
  198. 'html md-editor nav' { borderBottom = '0' borderRadius = radiusLarge + ' ' + radiusLarge + ' 0 0' }
  199. 'html md-editor nav button' { borderRadius = radiusSmall }
  200. 'html md-editor ul.files' { borderBottom = '0' }
  201. 'html md-editor link-form' { borderBottom = '0' background = colorSurface }
  202. 'html md-editor link-form input' { border = '0' borderRadius = radiusSmall }
  203. 'html md-editor link-form button' { border = '0' borderRadius = radiusSmall }
  204. 'html md-editor article img' { borderRadius = radiusLarge }
  205. 'html md-editor article code' { borderRadius = radiusSmall }
  206. 'html md-editor article pre' { border = '0' borderRadius = radiusLarge }
  207. 'html md-editor footer' { borderTop = '0' }
  208. 'html md-editor footer button' { border = '0' borderRadius = radiusSmall }
  209. // code editor: the gutter is a surface beside the sunken text, no line between them
  210. 'html code-editor' { border = '0' borderRadius = radiusLarge }
  211. 'html code-editor code-gutter' { borderRight = '0' }

Branches

Latest commits

  • 7f992d62gitoria#23: phone first on the shared theme — brand, branch and pull links 44 px, readme code 14 px; gate block "phone first" (15 pages at 390 + the three dropdowns, fails 20 on old), dropdown-aware login/logout clicks, check-theme in GATESmre
  • a2a840a5gitoria#23 WIP (quota stop): theme from layouts, styles inherit it, shell on the theme's header/menus/sidebar, phone measurement script; gates not runmre
  • 12b665b0mission brief 005mre
  • b680c483Revert "gitoria#22: RepoTabs wrapping component for the repo tabs (active tab, no content for a missing repo)"mre
  • 4fda244fgitoria#22: RepoTabs wrapping component for the repo tabs (active tab, no content for a missing repo)mre
  • 0fd5e280mission brief 004mre
  • e1d425e7paths: projects moved into /media/STORAGE/projects/WorldAPI/mre
  • e59ff114deploy.sh: wait up to DEPLOY_URL_WAIT (120 s) for 200 after the restart, as the other apps (cold compile, hybriel#148)mre
  • bcafcceb003: compose cache volume + tmpfs /tmp, gate start waits 120 s, report/LOG/STATUSmre
  • bed3f2d5Re-vendor Hybriel to the shared static build 0f396652 (plugins; bin/ is git-ignored)mre
  • 3207e128mission brief 003mre
  • 18ab71fbtests/ticketskit: wait up to 120 s for tickets (native Hybriel cold compile ~25 s, hybriel#148)mre
  • 4fffa966docker-compose: init: true (hybriel#156, PID 1 ignored SIGTERM, every restart waited 10 s)mre
  • 4f47843egate: ticket links use the tickets short URL (/<slug>/<n>, tickets#25)mre
  • 86605446mission 002 (code order) 4/4: README file map + import order + 'Same output' test + gate run with a tickets HEAD copy, STATUS (entry, lessons), LOG, report; tests/realdata-baseline.mjs + realdata-compare.py (a cleanup answers the same on live data: pages, modules, API, git over HTTPS and SSH, faces), tests/letcount.pymre
  • cc7bf7bamission 002 (code order) 3/4: let only where a variable is reassigned or re-bound in a loop body (289 lets → plain declarations; 213 left: 125 reassigned, 88 loop-bound; no member/import/param clash). gates 200/0, 46/0, 44/0; real-data reads + writes identical (browser modules: var → const only)mre
  • 090a20c6mission 002 (code order) 2/4: one lib/ file per topic — git.hl split into git (calls, branches, init, temp folder) / homepage / code / pulls / releases (+ git-helpers: paths, ids, |||PR/|||RL markers); repos-helpers, tickets-helpers, transport-helpers; util.hl = localtime + env, storage dir, addresses, lists, text checks, one newest-first sort (was 3 copies); the function routes out of project.hl into lib/api.hl (thin; plumbing in api-helpers.hl), sshgate.hl folded into api.hl + sshkeys.hl keyLine + repos.hl mayPush; 'Make main' and the merge answer out of the faces (code.hl makeMain, pulls.hl pullsView), one login helper (users.hl userOfLoginCode); project.hl is the map. Session-writing routes get &req + &server.sessions. gates 200/0, 46/0, 44/0; real-data identical except /login/failed now shows the parked reason for a browser that already had a session (the old copy-of-req lost it)mre
  • 110c2799mission 002 (code order) 1/4: .hl files out of the root — lib/ (api, git, localtime, markdown, repos, sshgate, sshkeys, tickets, tokens, transport, users), components/styles.hl; jsoncheck.hl removed (imported nowhere); import paths only. gates 200/0, 46/0, 44/0; real-data reads + writes identicalmre
  • fdfb4b1bgitoria: Hybriel master 06617221 (plugin allocators 3a781359 + 413f60e4, mpackdb 2cb7ae5e, http1 773de63e); gates 200/0, 46/0, 44/0mre
  • 5b46ac84antcolony#40: LOG.md — missions 069/072 are antcolony missions (report paths on Byrodin)mre