gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit029eb5e5029eb5e5deploy: security gate (tests/security.mjs)mre029eb5e5/components/styles.hl

12.1 KB

  1. // styles.hl — the app's CSS, served as /__hl/app.css. It INHERITS THE WORLDAPI THEME (theme/theme.hl, copied verbatim from
  2. // layouts.worldapi.org dbe3de7 — never edited here; docs: layouts docs/using-the-theme.md) and adds only what ident's own
  3. // pages need: the account bar, identities, the app request and choice, apps, the inbox and the per-app switches. Components
  4. // carry no Style blocks: markup is domain tags (<ident-card>, <app-request>, …), this file lays them out.
  5. //
  6. // TOKENS: colours only through the named tokens (shared/tokens.hl = layouts' file, byte-equal); the app sets only its accent
  7. // (orange). Corners: radiusSmall (5px: buttons, badges, rows' small parts) / radiusLarge (10px: panels, rows); '50%' for avatars.
  8. // Borderless — `node theme/check-theme.mjs .` must report 0 problems (a deploy gate).
  9. // In a styles file a bare name is a TAG (camelCase → kebab), a quoted name is a selector written verbatim; a selector the theme
  10. // already writes may not be written again (hl:web refuses it) — so the theme's own elements (links, headings, fields, buttons,
  11. // foldables, `.muted`, `p.empty`, the 44 px taps) are NOT repeated here.
  12. // PHONE FIRST (mission 012): every rule outside a block is the phone's (390 px): nothing makes the page wider than the screen,
  13. // every tap target is at least 44×44 px (the theme's layoutTap), every field 16 px, no text under 14 px (.875rem). The one
  14. // `@media (min-width: 60rem)` block at the bottom (the theme's breakpoint) only ADDS the wide layout.
  15. inherit '../theme/theme.hl'
  16. import { var } from 'hl:web/css'
  17. import { orange, colorText, colorTextStrong, colorBackgroundSunken, colorTextMuted, colorAccentText, colorDanger, colorSurface, colorSuccess, colorWarning } from '../shared/tokens.hl'
  18. colorAccent = var(orange) // the app's accent: the only token this app sets
  19. // ---- the shell (components/main.hl; the theme's shell files carry their own Style) ----------------------------------
  20. // the signed-in address at the top of the user menu
  21. 'user-menu p#whoami' { fontSize = '.875rem' }
  22. // offline (mission 046): the note under the header, and the probe's clock (components/main.hl)
  23. offlineNote { display = 'block' padding = '.5rem var(--layout-gutter)' color = colorWarning background = colorBackgroundSunken fontSize = '.875rem' fontWeight = '600' }
  24. netProbe { position = 'absolute' width = '0' height = '0' overflow = 'hidden' animation = 'ident-net-probe 20s .5s infinite' }
  25. '@keyframes ident-net-probe' = { 'from' = { opacity = '1' } to = { opacity = '0.99' } }
  26. // ---- the page column (login and signed in): centred, no panel ---------------------------------------------------------
  27. identCard { display = 'grid' gap = '1rem' maxWidth = '34rem' margin = '0 auto' }
  28. 'ident-card h1,
  29. ident-card h2,
  30. ident-card p' { margin = '0' }
  31. 'ident-card form' { display = 'grid' gap = '.8rem' }
  32. 'ident-card label' { display = 'grid' gap = '.25rem' marginBottom = '0' }
  33. 'ident-card .lead' { color = colorTextMuted }
  34. userEmail { display = 'block' color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  35. formButtons { display = 'flex' flexWrap = 'wrap' gap = '.5rem' }
  36. '.message' { margin = '0' minHeight = '1.5em' color = colorDanger }
  37. '.notice' { margin = '0' color = colorSuccess }
  38. '.notice:empty' { display = 'none' }
  39. fieldHint { color = colorTextMuted fontSize = '.875rem' fontWeight = '400' }
  40. '#code' { fontSize = '1.4rem' letterSpacing = '.3em' fontVariantNumeric = 'tabular-nums' }
  41. // ---- signed in: account bar, identities, time zone -----------------------------------------------------------------
  42. accountBar { display = 'flex' flexWrap = 'wrap' alignItems = 'center' justifyContent = 'space-between' gap = '.25rem .5rem' }
  43. 'account-bar a' { display = 'inline-flex' alignItems = 'center' minHeight = 'var(--layout-tap)' minWidth = 'var(--layout-tap)' justifyContent = 'center' }
  44. // PHONE: the user menu (header, a popover over the top right) carries the email, Sign out and Sign out everywhere, so the account bar
  45. // keeps only the page's own link, at the LEFT — the open menu then covers nothing of the page (tests/mobile.mjs)
  46. '@media (max-width: 59.99rem)' = {
  47. accountBar { justifyContent = 'flex-start' }
  48. 'account-bar user-email,
  49. #signout,
  50. #signoutall' { display = 'none' }
  51. }
  52. '#gohome' { justifySelf = 'start' }
  53. 'ident-card section' { display = 'grid' gap = '.8rem' }
  54. sectionHead { display = 'flex' flexWrap = 'wrap' alignItems = 'center' justifyContent = 'space-between' gap = '.5rem' }
  55. '#identities,
  56. #usedin,
  57. #chooselist,
  58. #apps,
  59. #inbox,
  60. #conns,
  61. #kinds' { listStyle = 'none' margin = '0' padding = '0' display = 'grid' gap = '.5rem' }
  62. '#identities li,
  63. #usedin li,
  64. #chooselist li,
  65. #apps li,
  66. #inbox li,
  67. #conns li,
  68. #kinds li' { display = 'flex' flexWrap = 'wrap' alignItems = 'center' justifyContent = 'space-between' gap = '.5rem' margin = '0' padding = '.7rem .8rem' background = colorSurface borderRadius = radiusLarge }
  69. identityMain { flex = '1 1 12rem' display = 'flex' flexWrap = 'wrap' alignItems = 'baseline' gap = '.2rem .5rem' minWidth = '0' }
  70. identityLabel { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }
  71. identityShortId { fontFamily = 'ui-monospace, monospace' fontSize = '.875rem' color = colorTextMuted letterSpacing = '.08em' userSelect = 'all' }
  72. defaultBadge { padding = '0 .5rem' fontSize = '.875rem' fontWeight = '700' color = colorAccentText background = colorAccent borderRadius = radiusSmall }
  73. identityDetails { flexBasis = '100%' color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  74. identityActions { display = 'flex' flexWrap = 'wrap' gap = '.4rem' }
  75. '#identities img.avatar, #chooselist img.avatar' { flex = '0 0 auto' width = '32px' height = '32px' objectFit = 'cover' borderRadius = '50%' background = colorBackgroundSunken }
  76. '#identityform,
  77. #appform' { display = 'grid' gap = '.8rem' padding = '1rem' background = colorSurface borderRadius = radiusLarge }
  78. '#identityform input,
  79. #appform input' { background = colorBackgroundSunken }
  80. '#avatarpreview' { width = '48px' height = '48px' objectFit = 'cover' borderRadius = '50%' background = colorBackgroundSunken }
  81. '#avatarpreview.hidden, #avatarremove.hidden' { display = 'none' }
  82. avatarField { display = 'flex' flexWrap = 'wrap' alignItems = 'center' gap = '.6rem' }
  83. // real Chrome: a file input has an intrinsic width (its "No file chosen" text) that pushed the form to 413 px at 390 — every grid/flex item may shrink
  84. '#identityform > *, #appform > *, avatar-field > label' { minWidth = '0' }
  85. 'avatar-field > label' { flex = '1 1 12rem' }
  86. '#identityform input[type=file]' { width = '100%' maxWidth = '100%' minWidth = '0' }
  87. '.avatar-note' { flexBasis = '100%' color = colorDanger fontSize = '.875rem' }
  88. '.avatar-note:empty' { display = 'none' }
  89. // ident#26: the identity's page ("Used in", after the #27 proposal 027-06) and the identities list's "Used in…" link
  90. identityHead { display = 'flex' alignItems = 'center' gap = '.8rem' }
  91. 'identity-head img.avatar' { flex = '0 0 auto' width = '48px' height = '48px' objectFit = 'cover' borderRadius = '50%' background = colorBackgroundSunken }
  92. 'a.backlink' { display = 'inline-flex' alignItems = 'center' minHeight = 'var(--layout-tap)' justifySelf = 'start' fontSize = '.875rem' }
  93. usedMain { flex = '1 1 10rem' display = 'grid' gap = '.15rem' minWidth = '0' }
  94. usedApp { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }
  95. usedLine { color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  96. 'a.chip, identity-actions a.used' { display = 'inline-flex' alignItems = 'center' justifyContent = 'center' minHeight = 'var(--layout-tap)' minWidth = 'var(--layout-tap)' padding = '0 .8rem' fontSize = '.875rem' background = colorBackgroundSunken borderRadius = radiusSmall }
  97. '#usedinsection' { marginTop = '.6rem' }
  98. '#timezonesection,
  99. #connsection,
  100. #kindssection,
  101. #overridesection' { marginTop = '.6rem' }
  102. // ---- the login button: the app's request and the identity choice ------------------------------------------------------
  103. appRequest { display = 'block' padding = '.7rem .8rem' color = colorText background = colorSurface borderRadius = radiusLarge overflowWrap = 'anywhere' }
  104. requestOrigin { display = 'block' color = colorTextMuted fontSize = '.875rem' }
  105. // ---- apps ---------------------------------------------------------------------------------------------------------------------
  106. appMain { flex = '1 1 14rem' display = 'grid' gap = '.15rem' minWidth = '0' }
  107. appName { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }
  108. appOrigins { color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  109. appKey { fontSize = '.875rem' color = colorTextMuted overflowWrap = 'anywhere' }
  110. code { fontFamily = 'ui-monospace, monospace' fontSize = '.875rem' color = colorTextStrong overflowWrap = 'anywhere' wordBreak = 'break-all' }
  111. secretBox { display = 'grid' gap = '.6rem' padding = '1rem' background = colorSurface borderRadius = radiusLarge }
  112. 'secret-box h2' { color = colorWarning }
  113. 'secret-box code' { display = 'block' padding = '.5rem .6rem' background = colorBackgroundSunken userSelect = 'all' }
  114. // ---- notifications: the inbox and the per-app page ------------------------------------------------------------------
  115. 'ident-card.wide' { maxWidth = '46rem' }
  116. unreadTotal { color = colorAccent fontSize = '.875rem' fontWeight = '600' }
  117. '#inbox li' { flexWrap = 'nowrap' alignItems = 'flex-start' justifyContent = 'flex-start' gap = '.7rem' }
  118. '#inbox li.read' { opacity = '.75' }
  119. '#inbox img.icon' { flex = '0 0 auto' width = '40px' height = '40px' objectFit = 'cover' borderRadius = radiusSmall background = colorBackgroundSunken }
  120. noteMain { flex = '1 1 auto' display = 'grid' gap = '.25rem' minWidth = '0' }
  121. noteHead { display = 'flex' flexWrap = 'wrap' alignItems = 'baseline' gap = '.2rem .5rem' }
  122. noteName { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }
  123. urgentBadge { padding = '0 .5rem' fontSize = '.875rem' fontWeight = '700' color = colorAccentText background = colorDanger borderRadius = radiusSmall }
  124. unreadBadge { padding = '0 .5rem' fontSize = '.875rem' fontWeight = '700' color = colorAccentText background = colorAccent borderRadius = radiusSmall }
  125. noteFrom { color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  126. noteText { whiteSpace = 'pre-wrap' overflowWrap = 'anywhere' }
  127. noteFoot { display = 'flex' flexWrap = 'wrap' alignItems = 'center' gap = '.2rem .8rem' color = colorTextMuted fontSize = '.875rem' }
  128. 'note-foot a' { display = 'inline-flex' alignItems = 'center' minHeight = 'var(--layout-tap)' }
  129. 'note-foot .toggle' { marginLeft = 'auto' }
  130. '#conns a.conn' { fontWeight = '700' overflowWrap = 'anywhere' }
  131. connDetails { color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  132. kindMain { flex = '1 1 12rem' display = 'grid' gap = '.15rem' minWidth = '0' }
  133. kindName { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }
  134. kindPreset { color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  135. kindSwitches { display = 'flex' flexWrap = 'wrap' gap = '.5rem 1rem' }
  136. switchRow { display = 'flex' alignItems = 'center' gap = '.5rem' }
  137. switchLabel { fontSize = '.875rem' color = colorTextMuted }
  138. // an on/off switch: off = a plain button, on = the accent
  139. 'button.switch' { minWidth = '3.6rem' fontSize = '.875rem' color = colorText background = colorBackgroundSunken }
  140. 'button.switch[aria-checked="true"]' { color = colorAccentText background = colorAccent }
  141. 'button.switch.locked' { opacity = '.45' cursor = 'not-allowed' }
  142. switchOff { display = 'inline-block' minWidth = '3.6rem' textAlign = 'center' color = colorTextMuted }
  143. '#overridesection switch-row' { justifyContent = 'space-between' maxWidth = '16rem' }
  144. '@media (min-width: 60rem)' = {
  145. 'ident-card' = { gap = '1.2rem' }
  146. }
  147. // the brand link of the theme's header is 43 px wide at 390 (the tap minimum is 44 × 44): a minimum width, here, because the theme
  148. // is never edited in an app
  149. 'html application-header > a.brand' { minWidth = 'var(--layout-tap)' } // (html + > : outranks the theme's own `application-header > a.brand { min-width: 0 }`; real Chrome measured it 43 px)

Branches

Latest commits

  • 029eb5e5deploy: security gate (tests/security.mjs)mre
  • d3c065a8security audit (SI): uploadMax 0, Secure __Host- cookie behind https, headers on function routes/files, page CSP+referrer meta, app/identity caps, tests/security.mjs, reportmre
  • 5561a0cbreport I4-mobilemre
  • 4ca2ed20404 page in the shell (viewport, status 404, way home); phone: account actions live in the user menu so the open menu covers nothing; mobile gate; signoutall waits for a cold startmre
  • 9baad745tests: browser gate waits for the reloaded document (offline reload race under CPU throttle); HL_CPU_THROTTLE knobmre
  • b96796bdtests: wait for hydration before real clicks after a navigation (H2)mre
  • 9722964fre-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
  • c9b196c9tests/iplimit: wait for the welcome form itself after B's first login (identities list renders before it); mission 017 reportmre
  • 72e0f587ident#26: identity page with "Used in" (app, since, last use, Notif. chip, empty state); lastLogin recorded at exchange; gates + lisbeth E2E; mission 016 reportmre
  • 94576fbcident#26 WIP: identity page /identity/:iid with "Used in" (app, since, last use, Notif. chip), lastLogin recorded at exchange, "Used in…" link on the identities list; apps gate 4b, e2e-usedin.mjsmre
  • 349cb502tests/invites: wait for hydration on the code page before entering the code (native GET submit raced the welcome form); mission 015 reportmre
  • d1bf4720tests: no hard-coded ports — every gate's ports and fixture origins come from <GATE>_PORT / _CHROME env (defaults unchanged; Bob/fixture origins follow, selector cookie name too)mre
  • 6280c92fre-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
  • 147744bftests/migration: the fixture app origin follows MIGRATION_GATE_TESTAPP_PORT (oldstore-009 OLD_TESTAPP)mre
  • 48cd36bctests/migration: ports from env (MIGRATION_GATE_PORT, MIGRATION_GATE_TESTAPP_PORT); 8395/8396 were taken by a foreign servermre
  • 3d9b2fd8docker-compose: nofile 65536 (Hybriel int 6+ boot opened >1024 files in the tracker)mre
  • 19b7e3c3deploy: backup copies index files first and *.mpack data last (hot-copy skew, hybriel #203)mre
  • c8a596f4re-vendor Hybriel 66c3db71 (web batch 4); e2e: main menu marked after in-place sign-in is a normal check; report 014mre
  • 8f3dc1ectests: delivery allow-list for the stopped server's network errors uses the gate port, not 8700mre
  • 9cc8eddftests: notify and iplimit gate Chrome ports from env (NOTIFY_GATE_CHROME, IPLIMIT_GATE_CHROME_A/B)mre