gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitf421cd60f421cd60ident#33: the shell's own rules (user menu address, offline note, network probe) move into main.hl's Stylemref421cd60/components/styles.hl

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

  • f421cd60ident#33: the shell's own rules (user menu address, offline note, network probe) move into main.hl's Stylemre
  • c512fb96Merge branch 'f4-homesplit' into mainIdent
  • 07d1717c|||PR ident#40 home.hl is split into components, one per area: email step, identity form, identity list, app identity choice, time zone; each moves its faces with it, the email step is shared with embed.hl (#40.3, rest of #40.2)mre
  • 59e8fcc1ident#40.3: the app's identity choice is one component (components/chooseidentity.hl); its face chooseIdentity moves with itmre
  • e23efdfcident#40.3: the identity list is one component (components/identitylist.hl); its delete and face dropIdentity move with itmre
  • e24b59a6ident#40.3: the time zone is one component (components/timezone.hl); its face changeTimeZone moves with itmre
  • 8cbc5717ident#40.3: the email step is one component (components/emailstep.hl) placed by home.hl and embed.hlmre
  • 6fad3bd2Merge branch 'f3-codestep' into mainIdent
  • 51e387f2|||PR ident#40 the code step is one component (components/codestep.hl) placed by home.hl and embed.hl; its verify face, setCode, browserZone and verify call exist once (#40.2)mre
  • c28bddeeMerge branch 'f2-shell' into mainIdent
  • c3a40ff6|||PR ident#40 one shell for the app and /start (account part off on /start, #40.1); startshell.hl removed; unused signOut faces gone (#40.4)mre
  • 060f3870ident#40.4: use the shell sign-out faces in regression gatesmre
  • 9b94aa6aMerge branch 'f1b-cleanup' into mainIdent
  • edcfce3f|||PR ident#41 ident#43 ident#44 login error page as a component (same status codes and text, pixel-identical), declarations and route wiring cleaned upmre
  • 3ac85995ident#43 ident#44: plain declarations for never-reassigned lets, one envString helper, named route functions and audience rule out of project.hlmre
  • c7eef14aMerge branch 'nv1-navigate' into mainIdent
  • 644f9775|||PR ident#36 navigate() instead of window.location in the shell, start shell and homemre
  • 4ca2f921deploy.sh: tar --hard-dereference so backups hold no hard linksmre
  • 23971fb7ident#49: media queries in the language's @media formmre
  • 73f4f97dident: re-vendor to hybriel day38b (mpackdb store-open fix)mre