gitoria

jukebox

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Branchday39cfe95440|||PR day39 re-vendor: Hybriel 51e921d7 (bin 6b481aa7), ids kebab-case since hybriel#256: quoted state rule and tests use jb-shuffle / jb-repeatmreday39/theme/shell/app-sidebar.hl

3.4 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. // slot content from the caller: nesting refused (hybriel#270)
  54. 'app-sidebar h2' {
  55. margin = '1rem 0 .35rem'
  56. padding = '0 .75rem'
  57. fontSize = '.8rem'
  58. fontWeight = '700'
  59. letterSpacing = '.04em'
  60. textTransform = 'uppercase'
  61. color = 'var(--color-text-muted)'
  62. }
  63. // slot content from the caller: nesting refused (hybriel#270)
  64. 'app-sidebar nav a' {
  65. display = 'flex'
  66. alignItems = 'center'
  67. minHeight = 'var(--layout-tap)'
  68. padding = '.45rem .75rem'
  69. color = 'var(--color-text)'
  70. borderRadius = 'var(--radius-small)'
  71. hover {
  72. textDecoration = 'none'
  73. color = 'var(--color-text-strong)'
  74. background = 'var(--color-surface)'
  75. }
  76. }
  77. // Keep the whole selector for selector list.
  78. 'app-sidebar nav a.current,
  79. app-sidebar nav a[aria-current="page"]' {
  80. color = 'var(--color-accent)'
  81. background = 'var(--color-surface)'
  82. }
  83. // Keep the whole selector for selector list.
  84. 'app-sidebar,
  85. app-sidebar:popover-open' {
  86. @media {
  87. minWidth = '60rem'
  88. position = 'static'
  89. inset = 'auto'
  90. display = 'block'
  91. width = 'auto'
  92. height = 'auto'
  93. margin = '0'
  94. padding = '0'
  95. overflow = 'visible'
  96. color = 'inherit'
  97. background = 'transparent'
  98. border = '0'
  99. }
  100. }
  101. // Keep the whole selector for selector list.
  102. 'app-sidebar.mobile-only,
  103. app-sidebar.mobile-only:popover-open' {
  104. @media {
  105. minWidth = '60rem'
  106. display = 'none'
  107. }
  108. }
  109. }
  110. View {
  111. appSidebar { id = "sidebar" class = cls popover = "auto" on click(e) { emit sidebarClick(e) }
  112. button { type = "button" class = "sidebar-close" popovertarget = "sidebar" popovertargetaction = "hide" title = closeLabel 'aria-label' = closeLabel "×" }
  113. slot
  114. }
  115. }
  116. // a tap on a link inside the open overlay closes it (a page change in place would leave it open)
  117. on sidebarClick(e) {
  118. if (e.target.closest('a') != null && e.currentTarget.matches(':popover-open')) { e.currentTarget.hidePopover() }
  119. }

Branches

Latest commits

  • cfe95440|||PR day39 re-vendor: Hybriel 51e921d7 (bin 6b481aa7), ids kebab-case since hybriel#256: quoted state rule and tests use jb-shuffle / jb-repeatmre
  • f3614c9bRe-vendor to Hybriel day39 (51e921d7, bin 6b481aa7)mre
  • 9f5c6532Merge branch 'status-22-pr' into mainJukebox
  • 5838d6c7|||PR STATUS: #22 pending decision, PR-only rulemre
  • 29d2029cRecords: PR-only rule (Kunibert)mre
  • adacb0abRecords: neutral ticket rule, #22 decision recordedmre
  • b2d6f121Records: #308 hold liftedmre
  • 7ab67533Records: day39 on hold (hybriel#308)mre
  • 22f21739Records: note rebase before mergemre
  • f7368ea3Records: mission 011 day39, waits for lisbethmre
  • 9515d2cdRecords: jb20 livemre
  • 019f6601ui gate: comment names the open bug components#27 (workaround, not fixed)mre
  • 277a2722README: provenance linemre
  • 4169ca6aREADME: sync pinmre
  • a01f3aa8ui gate: back to the top before the sort checks (the screen reopens where it was left)mre
  • f7936c20Lists keep their scroll position across a reload (jukebox#20): per-list offsets in storage/ui.json, gate jb20mre
  • d67906devirtual-list and icons from components.hybriel e5b98ec (centerId, scrollTop, onScroll)mre
  • df7920ceRecords: R3 startedmre
  • 0549f038Mission 010: jb20 livemre
  • 273494e2STATUS rewrittenmre