gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit24dd414e24dd414eident#34: the shared lead, message and notice looks are statics in components/styles.hl, imported by the components (lib/looks.hl gone)mre24dd414e/components/styles.hl

5.4 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 keeps only what is page-wide:
  3. // the app accent, the page column every page sits in, and the patterns several components share (form lines and buttons, the
  4. // account bar, the lists of rows, the form cards). Every component's own look is in its own Style block (ident#33).
  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) / radiusLarge (10px: panels, rows). Borderless — `node theme/check-theme.mjs .` must
  8. // 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 are NOT repeated here.
  11. // PHONE FIRST: every rule outside a block is the phone's (390 px); the `@media` blocks only ADD the wide layout (from 60rem,
  12. // the theme's breakpoint).
  13. inherit '../theme/theme.hl'
  14. import { var } from 'hl:web/css'
  15. import { orange, colorBackgroundSunken, colorTextStrong, colorTextMuted, colorDanger, colorSuccess, colorSurface } from '../shared/tokens.hl'
  16. colorAccent = var(orange) // the app's accent: the only token this app sets
  17. // ---- looks several components share: a component names one in its own Style (`pLead = leadLook`) and writes `Style.pLead` ----
  18. // (hybriel#253: Style.x does not find a rule of this file, so the body is a static the component imports.)
  19. static leadLook = {
  20. color = colorTextMuted
  21. }
  22. static messageLook = {
  23. margin = '0'
  24. minHeight = '1.5em'
  25. color = colorDanger
  26. }
  27. static noticeLook = {
  28. margin = '0'
  29. color = colorSuccess
  30. empty {
  31. display = 'none'
  32. }
  33. }
  34. // ---- the page column (every page, signed in or out): centred, no panel ----------------------------------------------------
  35. identCard {
  36. display = 'grid'
  37. gap = '1rem'
  38. maxWidth = '34rem'
  39. margin = '0 auto'
  40. }
  41. 'ident-card h1,
  42. ident-card h2,
  43. ident-card p' {
  44. margin = '0'
  45. }
  46. 'ident-card form' {
  47. display = 'grid'
  48. gap = '.8rem'
  49. }
  50. 'ident-card label' {
  51. display = 'grid'
  52. gap = '.25rem'
  53. marginBottom = '0'
  54. }
  55. 'ident-card section' {
  56. display = 'grid'
  57. gap = '.8rem'
  58. }
  59. // the wide pages (inbox, per-app settings, identity page)
  60. 'ident-card.wide' {
  61. maxWidth = '46rem'
  62. }
  63. @media {
  64. minWidth = '60rem'
  65. identCard {
  66. gap = '1.2rem'
  67. }
  68. }
  69. // ---- shared by several components: form lines, the status lines, section heads -----------------------------------------------
  70. formButtons {
  71. display = 'flex'
  72. flexWrap = 'wrap'
  73. gap = '.5rem'
  74. }
  75. fieldHint {
  76. color = colorTextMuted
  77. fontSize = '.875rem'
  78. fontWeight = '400'
  79. }
  80. sectionHead {
  81. display = 'flex'
  82. flexWrap = 'wrap'
  83. alignItems = 'center'
  84. justifyContent = 'space-between'
  85. gap = '.5rem'
  86. }
  87. code {
  88. fontFamily = 'ui-monospace, monospace'
  89. fontSize = '.875rem'
  90. color = colorTextStrong
  91. overflowWrap = 'anywhere'
  92. wordBreak = 'break-all'
  93. }
  94. // ---- signed in: the account bar of apps, inbox and per-app settings -------------------------------------------------------------
  95. // The user menu (header, a popover over the top right) carries the email, Sign out and Sign out everywhere on every page. On a PHONE the
  96. // account bar keeps only the page's own link, at the LEFT — the open menu then covers nothing of the page (tests/mobile.mjs); from 60rem
  97. // the address shows and the link goes to the right (ident#35: the phone is the base, the wide layout is added)
  98. accountBar {
  99. display = 'flex'
  100. flexWrap = 'wrap'
  101. alignItems = 'center'
  102. justifyContent = 'flex-start'
  103. gap = '.25rem .5rem'
  104. }
  105. 'account-bar a' {
  106. display = 'inline-flex'
  107. alignItems = 'center'
  108. minHeight = 'var(--layout-tap)'
  109. minWidth = 'var(--layout-tap)'
  110. justifyContent = 'center'
  111. }
  112. userEmail {
  113. display = 'none'
  114. color = colorTextMuted
  115. fontSize = '.875rem'
  116. overflowWrap = 'anywhere'
  117. }
  118. @media {
  119. minWidth = '60rem'
  120. accountBar {
  121. justifyContent = 'space-between'
  122. }
  123. userEmail {
  124. display = 'block'
  125. }
  126. }
  127. // ---- the lists of rows (identities, used in, choice, apps, inbox, connections, kinds): one pattern; each component adds its own parts
  128. '#identities,
  129. #usedin,
  130. #chooselist,
  131. #apps,
  132. #inbox,
  133. #conns,
  134. #kinds' {
  135. listStyle = 'none'
  136. margin = '0'
  137. padding = '0'
  138. display = 'grid'
  139. gap = '.5rem'
  140. }
  141. '#identities li,
  142. #usedin li,
  143. #chooselist li,
  144. #apps li,
  145. #inbox li,
  146. #conns li,
  147. #kinds li' {
  148. display = 'flex'
  149. flexWrap = 'wrap'
  150. alignItems = 'center'
  151. justifyContent = 'space-between'
  152. gap = '.5rem'
  153. margin = '0'
  154. padding = '.7rem .8rem'
  155. background = colorSurface
  156. borderRadius = radiusLarge
  157. }
  158. // ---- the form cards (the identity form and the app form) --------------------------------------------------------------------------
  159. '#identityform,
  160. #appform' {
  161. display = 'grid'
  162. gap = '.8rem'
  163. padding = '1rem'
  164. background = colorSurface
  165. borderRadius = radiusLarge
  166. }
  167. '#identityform input,
  168. #appform input' {
  169. background = colorBackgroundSunken
  170. }
  171. // every grid item may shrink (a wide field pushed the form past the screen)
  172. '#identityform > *,
  173. #appform > *' {
  174. minWidth = '0'
  175. }
  176. // 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
  177. // is never edited in an app
  178. 'html application-header > a.brand' {
  179. minWidth = 'var(--layout-tap)' // (html + > : outranks the theme's own `application-header > a.brand { min-width: 0 }`; real Chrome measured it 43 px)
  180. }

Branches

Latest commits

  • 24dd414eident#34: the shared lead, message and notice looks are statics in components/styles.hl, imported by the components (lib/looks.hl gone)mre
  • 03ed26c7ident#34: access.hl: the remaining lead classes droppedmre
  • 1d066c42ident#34: access.hl drops its unstyled lead class (the shared lead rule would otherwise mute it)mre
  • 1e1dd7b4ident#34: the access page keeps its lead class string (the page has no ident-card, so its lead line was never muted; a shared rule would change the look)mre
  • 89ac6553ident#34: the lead, message and notice lines are named with Style.pLead / pMessage / pNotice (shared bodies in lib/looks.hl) instead of class stringsmre
  • e84be3deident#34: browser gate lists the Edit/Delete buttons by namemre
  • fb7111faident#34: access page: unstyled test-hook classes (idrow, never, who, whoname, appname, neverrevoke) dropped; the tests use element/name selectorsmre
  • 9f2ad803ident#34: notification switches: push/email by name=..., locked by aria-disabled, the switch look is the role=switch button (no switch/push/email/locked classes)mre
  • e0f0ddaaident#34: inbox: the Mark read/unread button is styled as the button of its note-foot, the icon is found as the row's img (no toggle/icon classes)mre
  • 16b49756ident#34: unused row classes (choice, usedrow, kind, shortid) droppedmre
  • f9d6fb38ident#34: apps and identity rows: the Edit/New secret/Delete buttons carry name=..., the API key is found by its element; unused row classes (app, identity, shortid) droppedmre
  • b323265aMerge branch 'f5-styles' into mainIdent
  • 9ced53c3|||PR ident#33 ident#35 every component's styles live in its own Style block; styles.hl keeps the page-wide rest; the account bar is phone first (min-width: 60rem block); the avatar preview is hidden with the hidden attribute (ident#34 in part)mre
  • f28333e4ident#33 ident#35: styles.hl keeps only the accent, the page column and the shared patterns; the account bar is written phone first (base rule + one min-width: 60rem block) instead of a max-width overridemre
  • 5b4541fcident#33: the selector sign-in frame's rules move into embed.hl's Stylemre
  • 00235f21ident#33: the per-app notification switches move into appsettings.hl's Stylemre
  • 2249945cident#33: the inbox and connection list rules move into inbox.hl's Stylemre
  • f2d9f79fident#33: the apps list and the secret box move into apps.hl's Stylemre
  • 8370b748ident#33: the app request box moves into home.hl's Stylemre
  • 40bf3b97ident#33: the 404 page's home link rule moves into notfound.hlmre