gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit88e1d14d88e1d14d|||PR layouts#9: address Kunibert findings (3-pane 768px, :where invalid focus, placeholder & glow contrast)Atlas88e1d14d/theme/shell/app-header.hl

5.3 KB

  1. // app-header.hl — THE HEADER of a WorldAPI app: brand, search, main menu, user menu (docs/layouts/app-header.md).
  2. // Phone: [sidebar toggle] brand … [loupe] [user menu]; the main menu lives in the sidebar overlay, the search field opens
  3. // under the bar from the loupe. Desktop (768px+): brand · search in the middle · main menu · user menu; the toggle and the
  4. // loupe are gone. The bar's background runs full width, its contents start and end flush with the content column
  5. // (--layout-column); in the full-width shells (list-first, three-pane) they span the page.
  6. //
  7. // AppHeader { brand = "Tracker" search = "/search"
  8. // MainMenu { items = menu current = "/series" }
  9. // UserMenu { name = "az5b2" a { href = "/settings" "Settings" } a { href = "/logout" "Logout" } }
  10. // }
  11. //
  12. // The toggle opens `#sidebar` (theme/shell/app-sidebar.hl) with the browser's popover: no script, Esc and a tap outside
  13. // close it. A page without a sidebar shows no toggle. The search field is the popover `#app-search` on the phone.
  14. String brand = 'WorldAPI'
  15. String brandHref = '/'
  16. String search = '' // the search form's action ('' = no search); it sends GET <search>?<searchName>=…
  17. String searchName = 'q'
  18. String searchLabel = 'Search'
  19. String searchPlaceholder = 'Search…'
  20. String menuLabel = 'Menu'
  21. Boolean hasSearch = search != ''
  22. slot = null
  23. Style {
  24. applicationHeader {
  25. position = 'sticky'
  26. top = '0'
  27. zIndex = '20'
  28. display = 'flex'
  29. alignItems = 'center'
  30. gap = '.25rem'
  31. height = 'var(--layout-header)'
  32. paddingInline = 'max(var(--layout-gutter), calc((100% - var(--layout-column)) / 2))'
  33. background = 'var(--color-background-sunken)'
  34. '> a.brand' {
  35. flex = '0 1 auto'
  36. minWidth = '0'
  37. marginRight = 'auto'
  38. overflow = 'hidden'
  39. lineHeight = 'var(--layout-tap)'
  40. fontSize = '1.4rem'
  41. fontWeight = '100'
  42. color = 'var(--color-text-strong)'
  43. textOverflow = 'ellipsis'
  44. whiteSpace = 'nowrap'
  45. hover {
  46. textDecoration = 'none'
  47. color = 'var(--color-accent)'
  48. }
  49. }
  50. '> button' {
  51. flex = 'none'
  52. width = 'var(--layout-tap)'
  53. height = 'var(--layout-tap)'
  54. minHeight = '0'
  55. padding = '0'
  56. color = 'var(--color-text)'
  57. background = 'transparent'
  58. hover { background = 'var(--color-surface)' }
  59. }
  60. '> button.menu-toggle' { marginLeft = '-.625rem' }
  61. '> form.search:popover-open' {
  62. position = 'fixed'
  63. inset = 'var(--layout-header) 0 auto 0'
  64. display = 'block'
  65. width = '100%'
  66. height = 'auto'
  67. margin = '0'
  68. padding = '.5rem var(--layout-gutter) .75rem'
  69. color = 'var(--color-text)'
  70. background = 'var(--color-background-sunken)'
  71. border = '0'
  72. }
  73. '> form.search:not(:popover-open)' { display = 'none' }
  74. '> form.search' {
  75. input {
  76. width = '100%'
  77. minWidth = '0'
  78. minHeight = 'var(--layout-tap)'
  79. }
  80. }
  81. @media {
  82. minWidth = '768px'
  83. gap = '1rem'
  84. '> a.brand' { flexShrink = '0' }
  85. '> form.search' {
  86. input {
  87. minHeight = '2.25rem'
  88. padding = '.4rem .8rem'
  89. }
  90. }
  91. }
  92. }
  93. // Keep the whole selector for :has condition.
  94. 'body:not(:has(#sidebar)) application-header > button.menu-toggle' { display = 'none' }
  95. // Keep the whole selector for pseudo-element.
  96. 'application-header > form.search::backdrop' { background = 'transparent' }
  97. // Keep the whole selector for selector list, :has condition.
  98. 'body:has(list-first) application-header,
  99. body:has(three-pane) application-header' { paddingInline = 'var(--layout-gutter)' }
  100. // Keep the whole selector for selector list.
  101. 'application-header > button.menu-toggle,
  102. application-header > button.search-toggle' {
  103. @media {
  104. minWidth = '768px'
  105. display = 'none'
  106. }
  107. }
  108. @media {
  109. minWidth = '768px'
  110. // Keep the whole selector for selector list.
  111. 'application-header > form.search,
  112. application-header > form.search:not(:popover-open),
  113. application-header > form.search:popover-open' {
  114. position = 'static'
  115. inset = 'auto'
  116. display = 'flex'
  117. flex = '1 1 auto'
  118. minWidth = '0'
  119. width = 'auto'
  120. maxWidth = '28rem'
  121. height = 'auto'
  122. margin = '0 auto'
  123. padding = '0'
  124. overflow = 'visible'
  125. color = 'inherit'
  126. background = 'transparent'
  127. border = '0'
  128. }
  129. }
  130. }
  131. View {
  132. applicationHeader {
  133. button { type = "button" class = "menu-toggle" popovertarget = "sidebar" title = menuLabel 'aria-label' = menuLabel
  134. svg { viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" 'stroke-width' = "2" 'stroke-linecap' = "round" 'aria-hidden' = "true"
  135. path { d = "M4 6h16M4 12h16M4 18h16" }
  136. }
  137. }
  138. a { class = "brand" href = brandHref brand }
  139. if (hasSearch) {
  140. form { id = "app-search" class = "search" role = "search" method = "get" action = search popover = "auto" on toggle(e) { emit headerSearchToggle(e) }
  141. input { type = "search" name = searchName placeholder = searchPlaceholder 'aria-label' = searchLabel autocomplete = "off" }
  142. }
  143. button { type = "button" class = "search-toggle" popovertarget = "app-search" title = searchLabel 'aria-label' = searchLabel
  144. svg { viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" 'stroke-width' = "2" 'stroke-linecap' = "round" 'aria-hidden' = "true"
  145. circle { cx = "11" cy = "11" r = "6.5" }
  146. path { d = "M16 16l4.5 4.5" }
  147. }
  148. }
  149. }
  150. slot
  151. }
  152. }
  153. // the phone's search opened: the field takes the focus (the popover has none of its own)
  154. on headerSearchToggle(e) {
  155. if (e.newState == 'open') { e.target.querySelector('input').focus() }
  156. }

Branches

Latest commits

  • 88e1d14d|||PR layouts#9: address Kunibert findings (3-pane 768px, :where invalid focus, placeholder & glow contrast)Atlas
  • 8c875a78|||PR layouts#9: match HyperConductor look (lines 1-21)Atlas
  • 4099e64aMerge branch 'font-segoe-ui' into mainAtlas
  • e14fb795|||PR Theme font: Segoe UI first (his choice 2026-11-19)Atlas
  • 44071d2cMerge branch 'hl-standard-5' into mainAtlas
  • 5ea64202|||PR Gate: count the new-tab check's console errors tooAtlas
  • 2752ceddMerge branch 'hl-standard-4' into mainAtlas
  • ac552b81|||PR Gate: keyboard (Tab/Enter/Space) and Back/Forward/reload/new-tab checks (HL-STANDARD F5, F21)Atlas
  • 8cddcaa9Merge branch 'hl-standard-2' into mainAtlas
  • 2b480a64|||PR Type the route parameter of main-menu build (HL-STANDARD L10)Atlas
  • ab54a39dMerge branch 'hl-standard' into mainAtlas
  • 04d36fcf|||PR Type function parameters and drop unneeded let (HL-STANDARD L2, L10)Atlas
  • 220c8fa4Merge branch 'readme-audit' into mainAtlas
  • b78fb85a|||PR README matches the codemre
  • 9f351699Preserve comments and nest supported selectors without changing rendered outputmre
  • 97110ad9WIP: nest accepted layout selectors; stopped at startup parse failuremre
  • ce4a0baeKeep caller slot styles whole so minimal shell apps startmre
  • 12cd3992Re-vendor complete Hybriel plugins and runtime to day44mre
  • b05c20feBackup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
  • 8d9ed0b8Re-vendor complete Hybriel plugins and runtime to day39mre