gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit2027f6962027f696layouts#9: field focus glow back to HyperConductor's .45Atlas2027f696/theme/shell/app-sidebar.hl

3.7 KB

  1. // app-sidebar.hl — THE SIDEBAR: on the phone an overlay that slides in from the left below the bar, from
  2. // 768px a column of the shell (content-first, three-pane) (docs/layouts/app-sidebar.md). ONE per page: it is `#sidebar`.
  3. //
  4. // ContentFirst {
  5. // Sidebar { MainMenu { items = menu current = "/series" } nav { a { href = "/series/new" "New series" } } }
  6. // main { … }
  7. // }
  8. //
  9. // `desktop = "false"`: a sidebar for the phone only (it holds just the main menu, which the header shows on desktop).
  10. // The overlay is the browser's popover: Esc, a tap outside, the × and a tap on one of its links close it.
  11. String desktop = 'true'
  12. String closeLabel = 'Close'
  13. String cls = desktop == 'false' ? 'mobile-only' : ''
  14. slot = null
  15. Style {
  16. 'app-sidebar:popover-open' {
  17. position = 'fixed'
  18. inset = 'var(--layout-header) auto 0 0'
  19. display = 'flex'
  20. flexDirection = 'column'
  21. gap = '.5rem'
  22. width = 'var(--layout-sidebar)'
  23. height = 'auto'
  24. maxHeight = 'none'
  25. margin = '0'
  26. padding = '1rem'
  27. overflowY = 'auto'
  28. color = 'var(--color-text)'
  29. background = 'var(--color-background-sunken)'
  30. border = '0'
  31. }
  32. // Keep the whole selector for pseudo-element.
  33. 'app-sidebar::backdrop' {
  34. top = 'var(--layout-header)'
  35. background = 'var(--color-backdrop)'
  36. opacity = '1'
  37. }
  38. appSidebar {
  39. '> button.sidebar-close' {
  40. display = 'flex'
  41. width = 'var(--layout-tap)'
  42. height = 'var(--layout-tap)'
  43. minHeight = '0'
  44. marginLeft = 'auto'
  45. padding = '0'
  46. fontSize = '1.6rem'
  47. fontWeight = '400'
  48. lineHeight = '1'
  49. color = 'var(--color-text-muted)'
  50. background = 'transparent'
  51. hover { background = 'var(--color-surface)' }
  52. @media {
  53. minWidth = '768px'
  54. display = 'none'
  55. }
  56. }
  57. }
  58. // Keep the whole selector for selector list.
  59. 'app-sidebar,
  60. app-sidebar:popover-open' {
  61. @media {
  62. minWidth = '768px'
  63. position = 'static'
  64. inset = 'auto'
  65. display = 'flex'
  66. flexDirection = 'column'
  67. gap = '.5rem'
  68. width = 'var(--layout-sidebar)'
  69. height = 'auto'
  70. margin = '0'
  71. padding = '1rem'
  72. overflow = 'visible'
  73. color = 'var(--color-text)'
  74. background = 'var(--color-background-sunken)'
  75. border = '0'
  76. }
  77. }
  78. // Keep the whole selector for selector list.
  79. 'app-sidebar.mobile-only,
  80. app-sidebar.mobile-only:popover-open' {
  81. @media {
  82. minWidth = '768px'
  83. display = 'none'
  84. }
  85. }
  86. // Caller slot content is unknown here, so its selectors must be whole.
  87. 'app-sidebar a.brand,
  88. app-sidebar .brand' {
  89. display = 'block'
  90. fontSize = '1.75rem'
  91. fontWeight = '100'
  92. color = 'var(--color-text-strong)'
  93. }
  94. // Caller slot content is unknown here, so its selectors must be whole.
  95. 'app-sidebar h2' {
  96. margin = '.75rem 0 .25rem'
  97. padding = '0 .5rem'
  98. fontSize = '.8rem'
  99. fontWeight = '400'
  100. color = 'var(--color-text-muted)'
  101. }
  102. 'app-sidebar nav a' {
  103. display = 'flex'
  104. alignItems = 'center'
  105. minHeight = 'var(--layout-tap)'
  106. padding = '.25rem .5rem'
  107. color = 'var(--color-text)'
  108. borderRadius = 'var(--radius-small)'
  109. }
  110. 'app-sidebar nav a:hover' {
  111. textDecoration = 'none'
  112. color = 'var(--color-text-strong)'
  113. }
  114. // Keep the whole selector for selector list.
  115. 'app-sidebar nav a.current,
  116. app-sidebar nav a[aria-current="page"]' {
  117. color = 'var(--color-active-text)'
  118. background = 'var(--color-active-bg)'
  119. }
  120. }
  121. View {
  122. appSidebar { id = "sidebar" class = cls popover = "auto" on click(e) { emit sidebarClick(e) }
  123. button { type = "button" class = "sidebar-close" popovertarget = "sidebar" popovertargetaction = "hide" title = closeLabel 'aria-label' = closeLabel "×" }
  124. slot
  125. }
  126. }
  127. // a tap on a link inside the open overlay closes it (a page change in place would leave it open)
  128. on sidebarClick(e) {
  129. if (e.target.closest('a') != null && e.currentTarget.matches(':popover-open')) { e.currentTarget.hidePopover() }
  130. }

Branches

Latest commits

  • 2027f696layouts#9: field focus glow back to HyperConductor's .45Atlas
  • 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