gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitdc6d486fdc6d486fident#27: the docs gate expects the new Access entry in the main menumredc6d486f/components/styles.hl

13.7 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. // The user menu (header, a popover over the top right) carries the email, Sign out and Sign out everywhere on every page (the home page has
  45. // no account bar any more — creator 2026-10-24: the same account was shown twice). On a PHONE the apps / inbox account bars keep only the page's
  46. // own link, at the LEFT — the open menu then covers nothing of the page (tests/mobile.mjs)
  47. '@media (max-width: 59.99rem)' = {
  48. accountBar { justifyContent = 'flex-start' }
  49. 'account-bar user-email' { display = 'none' }
  50. }
  51. '#gohome' { justifySelf = 'start' }
  52. 'ident-card section' { display = 'grid' gap = '.8rem' }
  53. sectionHead { display = 'flex' flexWrap = 'wrap' alignItems = 'center' justifyContent = 'space-between' gap = '.5rem' }
  54. '#identities,
  55. #usedin,
  56. #chooselist,
  57. #apps,
  58. #inbox,
  59. #conns,
  60. #kinds' { listStyle = 'none' margin = '0' padding = '0' display = 'grid' gap = '.5rem' }
  61. '#identities li,
  62. #usedin li,
  63. #chooselist li,
  64. #apps li,
  65. #inbox li,
  66. #conns li,
  67. #kinds li' { display = 'flex' flexWrap = 'wrap' alignItems = 'center' justifyContent = 'space-between' gap = '.5rem' margin = '0' padding = '.7rem .8rem' background = colorSurface borderRadius = radiusLarge }
  68. identityMain { flex = '1 1 12rem' display = 'flex' flexWrap = 'wrap' alignItems = 'baseline' gap = '.2rem .5rem' minWidth = '0' }
  69. identityLabel { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }
  70. identityShortId { fontFamily = 'ui-monospace, monospace' fontSize = '.875rem' color = colorTextMuted letterSpacing = '.08em' userSelect = 'all' }
  71. defaultBadge { padding = '0 .5rem' fontSize = '.875rem' fontWeight = '700' color = colorAccentText background = colorAccent borderRadius = radiusSmall }
  72. identityDetails { flexBasis = '100%' color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  73. identityActions { display = 'flex' flexWrap = 'wrap' gap = '.4rem' }
  74. '#identities img.avatar, #chooselist img.avatar' { flex = '0 0 auto' width = '32px' height = '32px' objectFit = 'cover' borderRadius = '50%' background = colorBackgroundSunken }
  75. '#identityform,
  76. #appform' { display = 'grid' gap = '.8rem' padding = '1rem' background = colorSurface borderRadius = radiusLarge }
  77. '#identityform input,
  78. #appform input' { background = colorBackgroundSunken }
  79. '#avatarpreview' { width = '48px' height = '48px' objectFit = 'cover' borderRadius = '50%' background = colorBackgroundSunken }
  80. '#avatarpreview.hidden, #avatarremove.hidden' { display = 'none' }
  81. avatarField { display = 'flex' flexWrap = 'wrap' alignItems = 'center' gap = '.6rem' }
  82. // 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
  83. '#identityform > *, #appform > *, avatar-field > label' { minWidth = '0' }
  84. 'avatar-field > label' { flex = '1 1 12rem' }
  85. '#identityform input[type=file]' { width = '100%' maxWidth = '100%' minWidth = '0' }
  86. '.avatar-note' { flexBasis = '100%' color = colorDanger fontSize = '.875rem' }
  87. '.avatar-note:empty' { display = 'none' }
  88. // ident#26: the identity's page ("Used in", after the #27 proposal 027-06) and the identities list's "Used in…" link
  89. identityHead { display = 'flex' alignItems = 'center' gap = '.8rem' }
  90. 'identity-head img.avatar' { flex = '0 0 auto' width = '48px' height = '48px' objectFit = 'cover' borderRadius = '50%' background = colorBackgroundSunken }
  91. 'a.backlink' { display = 'inline-flex' alignItems = 'center' minHeight = 'var(--layout-tap)' justifySelf = 'start' fontSize = '.875rem' }
  92. usedMain { flex = '1 1 10rem' display = 'grid' gap = '.15rem' minWidth = '0' }
  93. usedApp { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }
  94. usedLine { color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  95. '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 }
  96. '#usedinsection' { marginTop = '.6rem' }
  97. '#timezonesection,
  98. #connsection,
  99. #kindssection,
  100. #overridesection' { marginTop = '.6rem' }
  101. // ---- the login button: the app's request and the identity choice ------------------------------------------------------
  102. appRequest { display = 'block' padding = '.7rem .8rem' color = colorText background = colorSurface borderRadius = radiusLarge overflowWrap = 'anywhere' }
  103. requestOrigin { display = 'block' color = colorTextMuted fontSize = '.875rem' }
  104. // ---- apps ---------------------------------------------------------------------------------------------------------------------
  105. appMain { flex = '1 1 14rem' display = 'grid' gap = '.15rem' minWidth = '0' }
  106. appName { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }
  107. appOrigins { color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  108. appKey { fontSize = '.875rem' color = colorTextMuted overflowWrap = 'anywhere' }
  109. code { fontFamily = 'ui-monospace, monospace' fontSize = '.875rem' color = colorTextStrong overflowWrap = 'anywhere' wordBreak = 'break-all' }
  110. secretBox { display = 'grid' gap = '.6rem' padding = '1rem' background = colorSurface borderRadius = radiusLarge }
  111. 'secret-box h2' { color = colorWarning }
  112. 'secret-box code' { display = 'block' padding = '.5rem .6rem' background = colorBackgroundSunken userSelect = 'all' }
  113. // ---- notifications: the inbox and the per-app page ------------------------------------------------------------------
  114. 'ident-card.wide' { maxWidth = '46rem' }
  115. unreadTotal { color = colorAccent fontSize = '.875rem' fontWeight = '600' }
  116. '#inbox li' { flexWrap = 'nowrap' alignItems = 'flex-start' justifyContent = 'flex-start' gap = '.7rem' }
  117. '#inbox li.read' { opacity = '.75' }
  118. '#inbox img.icon' { flex = '0 0 auto' width = '40px' height = '40px' objectFit = 'cover' borderRadius = radiusSmall background = colorBackgroundSunken }
  119. noteMain { flex = '1 1 auto' display = 'grid' gap = '.25rem' minWidth = '0' }
  120. noteHead { display = 'flex' flexWrap = 'wrap' alignItems = 'baseline' gap = '.2rem .5rem' }
  121. noteName { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }
  122. urgentBadge { padding = '0 .5rem' fontSize = '.875rem' fontWeight = '700' color = colorAccentText background = colorDanger borderRadius = radiusSmall }
  123. unreadBadge { padding = '0 .5rem' fontSize = '.875rem' fontWeight = '700' color = colorAccentText background = colorAccent borderRadius = radiusSmall }
  124. noteFrom { color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  125. noteText { whiteSpace = 'pre-wrap' overflowWrap = 'anywhere' }
  126. noteFoot { display = 'flex' flexWrap = 'wrap' alignItems = 'center' gap = '.2rem .8rem' color = colorTextMuted fontSize = '.875rem' }
  127. 'note-foot a' { display = 'inline-flex' alignItems = 'center' minHeight = 'var(--layout-tap)' }
  128. 'note-foot .toggle' { marginLeft = 'auto' }
  129. '#conns a.conn' { fontWeight = '700' overflowWrap = 'anywhere' }
  130. connDetails { color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  131. kindMain { flex = '1 1 12rem' display = 'grid' gap = '.15rem' minWidth = '0' }
  132. kindName { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }
  133. kindPreset { color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  134. kindSwitches { display = 'flex' flexWrap = 'wrap' gap = '.5rem 1rem' }
  135. switchRow { display = 'flex' alignItems = 'center' gap = '.5rem' }
  136. switchLabel { fontSize = '.875rem' color = colorTextMuted }
  137. // an on/off switch: off = a plain button, on = the accent
  138. 'button.switch' { minWidth = '3.6rem' fontSize = '.875rem' color = colorText background = colorBackgroundSunken }
  139. 'button.switch[aria-checked="true"]' { color = colorAccentText background = colorAccent }
  140. 'button.switch.locked' { opacity = '.45' cursor = 'not-allowed' }
  141. switchOff { display = 'inline-block' minWidth = '3.6rem' textAlign = 'center' color = colorTextMuted }
  142. '#overridesection switch-row' { justifyContent = 'space-between' maxWidth = '16rem' }
  143. // ---- the selector's sign-in frame (ident#31, components/embed.hl): inside the selector's panel (same surface colour), the same fields and buttons
  144. 'html:has(embed-card), body:has(embed-card)' { background = colorSurface }
  145. fitMark { position = 'absolute' width = '0' height = '0' overflow = 'hidden' animation = 'ident-frame-fit 1s infinite' }
  146. '@keyframes ident-frame-fit' = { 'from' = { opacity = '1' } to = { opacity = '0.99' } }
  147. embedCard { display = 'grid' gap = '.8rem' padding = '.5rem' }
  148. 'embed-card p' { margin = '0' overflowWrap = 'anywhere' }
  149. 'embed-card, embed-card form, embed-card label, embed-card input, embed-card li' { minWidth = '0' }
  150. 'embed-card input' { width = '100%' maxWidth = '100%' boxSizing = 'border-box' }
  151. 'embed-card #code' { fontSize = '1.2rem' letterSpacing = '.15em' }
  152. 'embed-card form' { display = 'grid' gap = '.8rem' }
  153. 'embed-card label' { display = 'grid' gap = '.25rem' marginBottom = '0' }
  154. 'embed-card .message:empty' { display = 'none' }
  155. 'embed-card .lead' { color = colorTextMuted }
  156. 'embed-card #chooselist' { listStyle = 'none' margin = '0' padding = '0' display = 'grid' gap = '.5rem' }
  157. 'embed-card #chooselist li' { background = colorBackgroundSunken flexWrap = 'nowrap' }
  158. 'embed-card identity-main' { flex = '1 1 auto' }
  159. 'embed-card #chooselist a.choose' { display = 'flex' flex = '1 1 auto' alignItems = 'center' minHeight = 'var(--layout-tap)' color = 'inherit' textDecoration = 'none' }
  160. 'embed-card a.button' { display = 'inline-flex' alignItems = 'center' justifyContent = 'center' minHeight = 'var(--layout-tap)' textDecoration = 'none' }
  161. '@media (min-width: 60rem)' = {
  162. 'ident-card' = { gap = '1.2rem' }
  163. }
  164. // 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
  165. // is never edited in an app
  166. '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

  • dc6d486fident#27: the docs gate expects the new Access entry in the main menumre
  • d277633cident#27: README: identity access and the introspect endpointmre
  • e999b0d3ident#27: the Access tab — one key per identity for all its apps: give access in three steps, the overview matrix, a cell's sheet (since, last use, level, rotate, revoke), the app's check POST /api/introspect, agent identities hidden from the login picker, an inbox icon in the header's icon style (gate: tests/access.mjs)mre
  • 436206fcident#47: deploy.sh runs the sign-in gate on the deploy's own port slot, like the sessionwrites and docs gates (the default 8700 can be taken by another process)mre
  • a4887ea3ident#47: the selector's sign-in frame no longer has a Continue button; the identity row itself is the link (gate tests/signin.mjs fails on the old code)mre
  • d8ec703dident#45: /docs shows docs/IDENT.md (hl:markdown, vendored from ac1ed9da), one Docs entry in the main menu, README for developers only, gates tests/docs.mjs and tests/sessionwrites.mjs in deploy.shmre
  • ec6aad35Merge branch 'a28g-amp-callsites' into d45-docsmre
  • 6bfbd3f2ident#45: docs/IDENT.md, what ident is and how it works; CONCEPT.md marks one id per app as droppedmre
  • c0edca26ident#28 A28G: write & at every call that hands a session to an &-parameter; gate tests/sessionwrites.mjs pins that sign-in, pending address, embed sign-in and selector land in the session filesmre
  • 80965c08ident#28: README says the deploy goes through the standbymre
  • 2f41670cident#28: ident-standby service on port 45012 (no background round in the standby) and deploy.sh hands over through standby-swap.shmre
  • a544b261ident#28: README names the new vendored Hybrielmre
  • 716860b0ident#28: gates follow Hybriel ac1ed9da (lazy sessions, meta attribute order, JSON key order, default X-Frame-Options switched off for the embed page)mre
  • 889e00fbident#28: Hybriel master ac1ed9da (sessions reload a newer file, a replayed reconnect carries the server session); a startup fault exits 1 (on Error)mre
  • f5a55f8aident#11: apps can ask for nickname, firstname and lastname (fields list on /api/exchange, new POST /api/profile); empty fields come back null; gate checks, READMEmre
  • d8be66ebident: report and log line for the widget cache and frame height changemre
  • 2068f61aident#31: browsers revalidate the widget scripts on every load; the sign-in frame is exactly as tall as the current step (the frame page reports its height, selector.js accepts it from ident only)mre
  • a22d2daaident#31: the sign-in frame is no taller than the tallest step needs (plain CSS height per width), gate check for itmre
  • a77d1b22ident#31: the welcome form keeps editId a plain value (browser gate), README, wider rows in the framemre
  • 5c481bfdident#31: sign in to ident inside the selector's panel (email, code, identity in an iframe; a new address goes to ident in the same tab and comes back)mre