gitoria

jukebox

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmain10f8a8c8Merge branch 'code-order' into mainJukeboxmain/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

  • 10f8a8c8Merge branch 'code-order' into mainJukebox
  • 204fc828Merge branch 'day72' into mainJukebox
  • 95f5faae|||PR jukebox#7 Drop needless let declarationsmre
  • 33072bb5|||PR Record day72 gates and Chrome proofmre
  • 95f2cd73|||PR Use typed parent methods for screen playback and local server facesmre
  • 6422a020Sync media-player at 51c3818mre
  • b582ba1cVendor complete Hybriel day72 plugin setmre
  • 02dccbc9Merge branch 'records-1119' into mainJukebox
  • a39e1c23|||PR Records: missions 013-015, reconnect fix livemre
  • fc7db075Merge branch 'reconnect-retry' into mainJukebox
  • ac6f4c6fL2: plain declaration for a in pickedNextmre
  • 2f335086Review round 2: only an explicit queue pick drops pend (not the automatic advance); jb23 records every source changemre
  • 3eb6695fReview fixes: action generation, queue pick clears pend, Previous/Next retry the decided request, typed handlersmre
  • 7a53c0c2|||PR A tap lost to a dead socket plays after reconnect (mission 015)mre
  • 1f0cd77bMerge branch 'records-day41' into mainJukebox
  • 67be229f|||PR Records: day41 live (PR #4), mission 012, statusmre
  • 0bb027daconductor: caramboleyo is the user, not owner/creatorApollo
  • 04f5d9d5Merge branch 'day41' into mainJukebox
  • 8ed6da45|||PR README: media-player pin df9e7dfmre
  • d5d45fc3|||PR media-player df9e7df (repeat-one fix), sync pin and SOURCEmre