gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit378bd432378bd432ident#34: the identity picture look is a static in styles.hl (Style.pAvatar); sizes stay with each listmre378bd432/components/styles.hl

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

Branches

Latest commits

  • 378bd432ident#34: the identity picture look is a static in styles.hl (Style.pAvatar); sizes stay with each listmre
  • 1cf79e7eident#34: the wide page column is a static in styles.hl (Style.pWide), not the class "wide"mre
  • ddc7d135Merge branch 'f7-hooks' into mainIdent
  • eee0b513|||PR ident#34 part: test-hook classes replaced by name/element/attribute selectors (tests adjusted), the shared lead/message/notice looks are statics in styles.hlmre
  • ccd6d0c4ident#34: browser gate: rowButton finds the row's button by namemre
  • 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