gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitfb7111fafb7111faident#34: access page: unstyled test-hook classes (idrow, never, who, whoname, appname, neverrevoke) dropped; the tests use element/name selectorsmrefb7111fa/components/styles.hl

5.2 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. // ---- the page column (every page, signed in or out): centred, no panel ----------------------------------------------------
  18. identCard {
  19. display = 'grid'
  20. gap = '1rem'
  21. maxWidth = '34rem'
  22. margin = '0 auto'
  23. }
  24. 'ident-card h1,
  25. ident-card h2,
  26. ident-card p' {
  27. margin = '0'
  28. }
  29. 'ident-card form' {
  30. display = 'grid'
  31. gap = '.8rem'
  32. }
  33. 'ident-card label' {
  34. display = 'grid'
  35. gap = '.25rem'
  36. marginBottom = '0'
  37. }
  38. 'ident-card .lead' {
  39. color = colorTextMuted
  40. }
  41. 'ident-card section' {
  42. display = 'grid'
  43. gap = '.8rem'
  44. }
  45. // the wide pages (inbox, per-app settings, identity page)
  46. 'ident-card.wide' {
  47. maxWidth = '46rem'
  48. }
  49. @media {
  50. minWidth = '60rem'
  51. identCard {
  52. gap = '1.2rem'
  53. }
  54. }
  55. // ---- shared by several components: form lines, the status lines, section heads -----------------------------------------------
  56. formButtons {
  57. display = 'flex'
  58. flexWrap = 'wrap'
  59. gap = '.5rem'
  60. }
  61. '.message' {
  62. margin = '0'
  63. minHeight = '1.5em'
  64. color = colorDanger
  65. }
  66. '.notice' {
  67. margin = '0'
  68. color = colorSuccess
  69. }
  70. '.notice:empty' {
  71. display = 'none'
  72. }
  73. fieldHint {
  74. color = colorTextMuted
  75. fontSize = '.875rem'
  76. fontWeight = '400'
  77. }
  78. sectionHead {
  79. display = 'flex'
  80. flexWrap = 'wrap'
  81. alignItems = 'center'
  82. justifyContent = 'space-between'
  83. gap = '.5rem'
  84. }
  85. code {
  86. fontFamily = 'ui-monospace, monospace'
  87. fontSize = '.875rem'
  88. color = colorTextStrong
  89. overflowWrap = 'anywhere'
  90. wordBreak = 'break-all'
  91. }
  92. // ---- signed in: the account bar of apps, inbox and per-app settings -------------------------------------------------------------
  93. // 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
  94. // 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
  95. // the address shows and the link goes to the right (ident#35: the phone is the base, the wide layout is added)
  96. accountBar {
  97. display = 'flex'
  98. flexWrap = 'wrap'
  99. alignItems = 'center'
  100. justifyContent = 'flex-start'
  101. gap = '.25rem .5rem'
  102. }
  103. 'account-bar a' {
  104. display = 'inline-flex'
  105. alignItems = 'center'
  106. minHeight = 'var(--layout-tap)'
  107. minWidth = 'var(--layout-tap)'
  108. justifyContent = 'center'
  109. }
  110. userEmail {
  111. display = 'none'
  112. color = colorTextMuted
  113. fontSize = '.875rem'
  114. overflowWrap = 'anywhere'
  115. }
  116. @media {
  117. minWidth = '60rem'
  118. accountBar {
  119. justifyContent = 'space-between'
  120. }
  121. userEmail {
  122. display = 'block'
  123. }
  124. }
  125. // ---- the lists of rows (identities, used in, choice, apps, inbox, connections, kinds): one pattern; each component adds its own parts
  126. '#identities,
  127. #usedin,
  128. #chooselist,
  129. #apps,
  130. #inbox,
  131. #conns,
  132. #kinds' {
  133. listStyle = 'none'
  134. margin = '0'
  135. padding = '0'
  136. display = 'grid'
  137. gap = '.5rem'
  138. }
  139. '#identities li,
  140. #usedin li,
  141. #chooselist li,
  142. #apps li,
  143. #inbox li,
  144. #conns li,
  145. #kinds li' {
  146. display = 'flex'
  147. flexWrap = 'wrap'
  148. alignItems = 'center'
  149. justifyContent = 'space-between'
  150. gap = '.5rem'
  151. margin = '0'
  152. padding = '.7rem .8rem'
  153. background = colorSurface
  154. borderRadius = radiusLarge
  155. }
  156. // ---- the form cards (the identity form and the app form) --------------------------------------------------------------------------
  157. '#identityform,
  158. #appform' {
  159. display = 'grid'
  160. gap = '.8rem'
  161. padding = '1rem'
  162. background = colorSurface
  163. borderRadius = radiusLarge
  164. }
  165. '#identityform input,
  166. #appform input' {
  167. background = colorBackgroundSunken
  168. }
  169. // every grid item may shrink (a wide field pushed the form past the screen)
  170. '#identityform > *,
  171. #appform > *' {
  172. minWidth = '0'
  173. }
  174. // 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
  175. // is never edited in an app
  176. 'html application-header > a.brand' {
  177. minWidth = 'var(--layout-tap)' // (html + > : outranks the theme's own `application-header > a.brand { min-width: 0 }`; real Chrome measured it 43 px)
  178. }

Branches

Latest commits

  • 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
  • 40627a89ident#33: the time zone section's spacing moves into timezone.hlmre
  • d389db08ident#33: the identity page's rules and the Notif. chip move into identity.hl's Stylemre
  • ddda0b5bident#33: the identity row's parts move into identitylist.hl's Stylemre
  • 47e516afident#33 ident#34: the identity form's avatar rules move into identityform.hl; the preview and Remove button are hidden with the hidden attribute instead of built class strings (avatarPreviewClass, avatarRemoveClass gone)mre
  • 5cb5cf0eident#33: the code field's look moves into codestep.hl's Stylemre
  • f421cd60ident#33: the shell's own rules (user menu address, offline note, network probe) move into main.hl's Stylemre