gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitb7a61546b7a61546ident mission 013: e2e — in-place main-menu mark kept as a known gapmreb7a61546/components/styles.hl

10.6 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. 'ident-card section' { display = 'grid' gap = '.8rem' }
  45. sectionHead { display = 'flex' flexWrap = 'wrap' alignItems = 'center' justifyContent = 'space-between' gap = '.5rem' }
  46. '#identities,
  47. #chooselist,
  48. #apps,
  49. #inbox,
  50. #conns,
  51. #kinds' { listStyle = 'none' margin = '0' padding = '0' display = 'grid' gap = '.5rem' }
  52. '#identities li,
  53. #chooselist li,
  54. #apps li,
  55. #inbox li,
  56. #conns li,
  57. #kinds li' { display = 'flex' flexWrap = 'wrap' alignItems = 'center' justifyContent = 'space-between' gap = '.5rem' margin = '0' padding = '.7rem .8rem' background = colorSurface borderRadius = radiusLarge }
  58. identityMain { flex = '1 1 12rem' display = 'flex' flexWrap = 'wrap' alignItems = 'baseline' gap = '.2rem .5rem' minWidth = '0' }
  59. identityLabel { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }
  60. identityShortId { fontFamily = 'ui-monospace, monospace' fontSize = '.875rem' color = colorTextMuted letterSpacing = '.08em' userSelect = 'all' }
  61. defaultBadge { padding = '0 .5rem' fontSize = '.875rem' fontWeight = '700' color = colorAccentText background = colorAccent borderRadius = radiusSmall }
  62. identityDetails { flexBasis = '100%' color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  63. identityActions { display = 'flex' flexWrap = 'wrap' gap = '.4rem' }
  64. '#identities img.avatar, #chooselist img.avatar' { flex = '0 0 auto' width = '32px' height = '32px' objectFit = 'cover' borderRadius = '50%' background = colorBackgroundSunken }
  65. '#identityform,
  66. #appform' { display = 'grid' gap = '.8rem' padding = '1rem' background = colorSurface borderRadius = radiusLarge }
  67. '#identityform input,
  68. #appform input' { background = colorBackgroundSunken }
  69. '#avatarpreview' { width = '48px' height = '48px' objectFit = 'cover' borderRadius = '50%' background = colorBackgroundSunken }
  70. '#avatarpreview.hidden, #avatarremove.hidden' { display = 'none' }
  71. avatarField { display = 'flex' flexWrap = 'wrap' alignItems = 'center' gap = '.6rem' }
  72. // 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
  73. '#identityform > *, #appform > *, avatar-field > label' { minWidth = '0' }
  74. 'avatar-field > label' { flex = '1 1 12rem' }
  75. '#identityform input[type=file]' { width = '100%' maxWidth = '100%' minWidth = '0' }
  76. '.avatar-note' { flexBasis = '100%' color = colorDanger fontSize = '.875rem' }
  77. '.avatar-note:empty' { display = 'none' }
  78. '#timezonesection,
  79. #connsection,
  80. #kindssection,
  81. #overridesection' { marginTop = '.6rem' }
  82. // ---- the login button: the app's request and the identity choice ------------------------------------------------------
  83. appRequest { display = 'block' padding = '.7rem .8rem' color = colorText background = colorSurface borderRadius = radiusLarge overflowWrap = 'anywhere' }
  84. requestOrigin { display = 'block' color = colorTextMuted fontSize = '.875rem' }
  85. // ---- apps ---------------------------------------------------------------------------------------------------------------------
  86. appMain { flex = '1 1 14rem' display = 'grid' gap = '.15rem' minWidth = '0' }
  87. appName { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }
  88. appOrigins { color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  89. appKey { fontSize = '.875rem' color = colorTextMuted overflowWrap = 'anywhere' }
  90. code { fontFamily = 'ui-monospace, monospace' fontSize = '.875rem' color = colorTextStrong overflowWrap = 'anywhere' wordBreak = 'break-all' }
  91. secretBox { display = 'grid' gap = '.6rem' padding = '1rem' background = colorSurface borderRadius = radiusLarge }
  92. 'secret-box h2' { color = colorWarning }
  93. 'secret-box code' { display = 'block' padding = '.5rem .6rem' background = colorBackgroundSunken userSelect = 'all' }
  94. // ---- notifications: the inbox and the per-app page ------------------------------------------------------------------
  95. 'ident-card.wide' { maxWidth = '46rem' }
  96. unreadTotal { color = colorAccent fontSize = '.875rem' fontWeight = '600' }
  97. '#inbox li' { flexWrap = 'nowrap' alignItems = 'flex-start' justifyContent = 'flex-start' gap = '.7rem' }
  98. '#inbox li.read' { opacity = '.75' }
  99. '#inbox img.icon' { flex = '0 0 auto' width = '40px' height = '40px' objectFit = 'cover' borderRadius = radiusSmall background = colorBackgroundSunken }
  100. noteMain { flex = '1 1 auto' display = 'grid' gap = '.25rem' minWidth = '0' }
  101. noteHead { display = 'flex' flexWrap = 'wrap' alignItems = 'baseline' gap = '.2rem .5rem' }
  102. noteName { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }
  103. urgentBadge { padding = '0 .5rem' fontSize = '.875rem' fontWeight = '700' color = colorAccentText background = colorDanger borderRadius = radiusSmall }
  104. unreadBadge { padding = '0 .5rem' fontSize = '.875rem' fontWeight = '700' color = colorAccentText background = colorAccent borderRadius = radiusSmall }
  105. noteFrom { color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  106. noteText { whiteSpace = 'pre-wrap' overflowWrap = 'anywhere' }
  107. noteFoot { display = 'flex' flexWrap = 'wrap' alignItems = 'center' gap = '.2rem .8rem' color = colorTextMuted fontSize = '.875rem' }
  108. 'note-foot a' { display = 'inline-flex' alignItems = 'center' minHeight = 'var(--layout-tap)' }
  109. 'note-foot .toggle' { marginLeft = 'auto' }
  110. '#conns a.conn' { fontWeight = '700' overflowWrap = 'anywhere' }
  111. connDetails { color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  112. kindMain { flex = '1 1 12rem' display = 'grid' gap = '.15rem' minWidth = '0' }
  113. kindName { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }
  114. kindPreset { color = colorTextMuted fontSize = '.875rem' overflowWrap = 'anywhere' }
  115. kindSwitches { display = 'flex' flexWrap = 'wrap' gap = '.5rem 1rem' }
  116. switchRow { display = 'flex' alignItems = 'center' gap = '.5rem' }
  117. switchLabel { fontSize = '.875rem' color = colorTextMuted }
  118. // an on/off switch: off = a plain button, on = the accent
  119. 'button.switch' { minWidth = '3.6rem' fontSize = '.875rem' color = colorText background = colorBackgroundSunken }
  120. 'button.switch[aria-checked="true"]' { color = colorAccentText background = colorAccent }
  121. 'button.switch.locked' { opacity = '.45' cursor = 'not-allowed' }
  122. switchOff { display = 'inline-block' minWidth = '3.6rem' textAlign = 'center' color = colorTextMuted }
  123. '#overridesection switch-row' { justifyContent = 'space-between' maxWidth = '16rem' }
  124. '@media (min-width: 60rem)' = {
  125. 'ident-card' = { gap = '1.2rem' }
  126. }
  127. // 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
  128. // is never edited in an app
  129. '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

  • b7a61546ident mission 013: e2e — in-place main-menu mark kept as a known gapmre
  • 59b43d81ident mission 013: sign out everywhere keeps this browser's own (signed-out) session so the page goes on in placemre
  • 716e14ffident mission 013: browser gate — Bob signs out everywhere (no second code request)mre
  • 5885f1c9ident mission 013 step 2: stopgap reload removed (in-place sign-in/out reach the shell via emit, notices back, route-marked main menu), gates updatedmre
  • 734ac0a9ident mission 013 step 1: re-vendor Hybriel ce6f2e0a (plugins whole; bin/ is git-ignored)mre
  • b37875ccident mission 012 part 3: real-Chrome fixes (brand 44 px, identity form width), e2e walk, report, logmre
  • f989c2ebident mission 012: stopgap reload after in-place sign-in/sign-out (until hybriel#193), gates wait for cold start, welcome end reloadsmre
  • 443291d4ident mission 012: /start on its own shell (no account), browser gate 152/0, reportmre
  • 021dd0fcident mission 012: browser gate waits cold start (IDENT_COLD_MS), header selectors, e2e checks; shell events from a page do not reach it (probe), current not marked, account-bar link 44 pxmre
  • 97f77b07ident mission 012 (WIP): onto the layouts theme dbe3de7, shell on AppHeader/MainMenu/UserMenu/Sidebar + ContentFirst, styles cut, check-theme gatemre
  • 8e4f435bpaths: projects moved into /media/STORAGE/projects/WorldAPI/mre
  • fa288f63ident mission 011: report wording (Intl zone names)mre
  • 961fae01ident mission 011: report, LOG, STATUSmre
  • 65348039ident#7: delivery gate — console check split at the gate's own server restart (49 checks)mre
  • dfa7b783ident#7: README (Delivery, env, gate, files, data), deploy.sh runs tests/delivery.mjsmre
  • ab6331f4ident#7: tests/delivery.mjs — fake clock gate: Vienna/New York/Tokyo/UTC 17:00, urgent, mail off, restart, DST days, zone changemre
  • 7869f57bident#7: delivery — the daily mail at 17:00 in the user's zone (digests table, once per local day, test clock IDENT_TEST_CLOCK), urgent mailed at once, push hookmre
  • 371ef1b5ident#7: lib/mail.hl sendNotificationMail (sink: <sink>.mail, one JSON line per mail)mre
  • 39749e0bident#7: time zones through hl:time — server checks isZone, an account without a known zone reads as UTC, allAccountsmre
  • 7a54fe72mission brief 011mre