gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitdc77fb95dc77fb95main: offline note from __hlOnline, tick removed (#29)mredc77fb95/theme/shell/app-sidebar.hl

3.3 KB

  1. // app-sidebar.hl — THE SIDEBAR: on the phone an overlay that slides in from the left (the header's toggle opens it), from
  2. // 60rem 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 = '0 auto 0 0'
  19. display = 'block'
  20. width = 'min(20rem, 86vw)'
  21. height = '100dvh'
  22. maxHeight = 'none'
  23. margin = '0'
  24. padding = '.5rem 1rem 2rem'
  25. overflowY = 'auto'
  26. color = 'var(--color-text)'
  27. background = 'var(--color-background-sunken)'
  28. border = '0'
  29. }
  30. // Keep the whole selector for pseudo-element.
  31. 'app-sidebar::backdrop' {
  32. background = 'var(--color-background-sunken)'
  33. opacity = '.7'
  34. }
  35. appSidebar {
  36. '> button.sidebar-close' {
  37. display = 'flex'
  38. width = 'var(--layout-tap)'
  39. height = 'var(--layout-tap)'
  40. minHeight = '0'
  41. marginLeft = 'auto'
  42. padding = '0'
  43. fontSize = '1.6rem'
  44. fontWeight = '400'
  45. lineHeight = '1'
  46. color = 'var(--color-text-muted)'
  47. @media {
  48. minWidth = '60rem'
  49. display = 'none'
  50. }
  51. }
  52. }
  53. // Keep the whole selector for selector list.
  54. 'app-sidebar nav a.current,
  55. app-sidebar nav a[aria-current="page"]' {
  56. color = 'var(--color-accent)'
  57. background = 'var(--color-surface)'
  58. }
  59. // Keep the whole selector for selector list.
  60. 'app-sidebar,
  61. app-sidebar:popover-open' {
  62. @media {
  63. minWidth = '60rem'
  64. position = 'static'
  65. inset = 'auto'
  66. display = 'block'
  67. width = 'auto'
  68. height = 'auto'
  69. margin = '0'
  70. padding = '0'
  71. overflow = 'visible'
  72. color = 'inherit'
  73. background = 'transparent'
  74. border = '0'
  75. }
  76. }
  77. // Keep the whole selector for selector list.
  78. 'app-sidebar.mobile-only,
  79. app-sidebar.mobile-only:popover-open' {
  80. @media {
  81. minWidth = '60rem'
  82. display = 'none'
  83. }
  84. }
  85. // Caller slot content is unknown here, so its selectors must be whole.
  86. 'app-sidebar h2' {
  87. margin = '1rem 0 .35rem'
  88. padding = '0 .75rem'
  89. fontSize = '.8rem'
  90. fontWeight = '700'
  91. letterSpacing = '.04em'
  92. textTransform = 'uppercase'
  93. color = 'var(--color-text-muted)'
  94. }
  95. 'app-sidebar nav a' {
  96. display = 'flex'
  97. alignItems = 'center'
  98. minHeight = 'var(--layout-tap)'
  99. padding = '.45rem .75rem'
  100. color = 'var(--color-text)'
  101. borderRadius = 'var(--radius-small)'
  102. }
  103. 'app-sidebar nav a:hover' {
  104. textDecoration = 'none'
  105. color = 'var(--color-text-strong)'
  106. background = 'var(--color-surface)'
  107. }
  108. }
  109. View {
  110. appSidebar { id = "sidebar" class = cls popover = "auto" on click(e) { emit sidebarClick(e) }
  111. button { type = "button" class = "sidebar-close" popovertarget = "sidebar" popovertargetaction = "hide" title = closeLabel 'aria-label' = closeLabel "×" }
  112. slot
  113. }
  114. }
  115. // a tap on a link inside the open overlay closes it (a page change in place would leave it open)
  116. on sidebarClick(e) {
  117. if (e.target.closest('a') != null && e.currentTarget.matches(':popover-open')) { e.currentTarget.hidePopover() }
  118. }

Branches

Latest commits

  • dc77fb95main: offline note from __hlOnline, tick removed (#29)mre
  • 37a86d93tests/reviews: seeded fake hook's DNS failures are not server errors (flaky gate)mre
  • 07ab845bvendor: Hybriel set-day50 (run() leak fix #335)mre
  • 71b2fa4blog: hybriel#335mre
  • bd94cc7elog: #25 cause found (run() leak)mre
  • 565cb508log: H25 round 1mre
  • 90a0af84log: H25 startedmre
  • 87bd53b8mission H25mre
  • 71a746cflog: day48 livemre
  • bf568e14log: V48 mergedmre
  • 09955dedMerge v48: Hybriel set-day48, theme layouts ce4a0bamre
  • f2a2b0cevendor: Hybriel set-day48, theme layouts ce4a0bamre
  • 5d0834e7log: Apollo model rulemre
  • fe8e5bd5log: #25 sample, V48 missionmre
  • 8580c5d9log: theme fix from Atlasmre
  • 46823d93log: Apollo budget correctionmre
  • f6d32341log: Apollo on budget and #25 nextmre
  • d7184f53log: batch live, #25 evidencemre
  • 5e25e816log: W61 mergedmre
  • aafe330dTidy: drop evidence JSON (kept in scratch), collapse blank linesmre