gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Branchv61-day6183faeb15|||PR ident: vendor Hybriel day61mrev61-day61/components/styles.hl

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

Branches

Latest commits

  • 83faeb15|||PR ident: vendor Hybriel day61mre
  • b2572b34Merge branch 'v59-day59' into mainIdent
  • 67cf016d|||PR ident: vendor Hybriel day59mre
  • 600c043dMerge branch 'v58-day58' into mainIdent
  • 365f8c80|||PR ident: vendor Hybriel day58mre
  • 585126e5Merge branch 'f16-setf' into mainIdent
  • 953bf03a|||PR ident setF mirror dropped (hybriel#370)mre
  • a1419d9cMerge branch 'f15-navigate' into mainIdent
  • 3b3e451f|||PR ident#36 navigate to the app instead of location.assignmre
  • e36f4516Merge branch 'f14-online' into mainIdent
  • 2c5eac91|||PR ident#38 online state without probe timermre
  • bf1980f2Merge branch 'v56-day56' into mainIdent
  • 62ae0adf|||PR ident: vendor Hybriel day56mre
  • 0d18abc4Merge branch 'f13-avatar' into mainIdent
  • 2a99730a|||PR ident#37 avatar in hlmre
  • fa4ed25bMerge branch 'f11-upsert' into mainIdent
  • 8f3d9bc9|||PR ident#42 keyed upsert and removemre
  • 675493b1ident#42: editing an identity upserts the one edited row (face editIdentity answers { identity, row }); a create or delete keeps the whole list because the rows' position-dependent parts (default, Delete, Identity n) changemre
  • 45e55303ident#42: an app write patches one row: upsert on create, edit and new secret, one-argument remove on delete; the faces answer the changed app (or the deleted id), not the whole listmre
  • 991641d4Merge branch 'f10-access' into mainIdent