gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit3519930335199303content-first: format Style with nested rules and bare mediamre35199303/theme/shell/app-sidebar.hl

3.5 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. // No language form for the popover-open pseudo-class.
  17. 'app-sidebar:popover-open' {
  18. position = 'fixed'
  19. inset = '0 auto 0 0'
  20. display = 'block'
  21. width = 'min(20rem, 86vw)'
  22. height = '100dvh'
  23. maxHeight = 'none'
  24. margin = '0'
  25. padding = '.5rem 1rem 2rem'
  26. overflowY = 'auto'
  27. color = 'var(--color-text)'
  28. background = 'var(--color-background-sunken)'
  29. border = '0'
  30. }
  31. // No language form for the backdrop pseudo-element.
  32. 'app-sidebar::backdrop' {
  33. background = 'var(--color-background-sunken)'
  34. opacity = '.7'
  35. }
  36. // No language form for direct-child combinator.
  37. 'app-sidebar > button.sidebar-close' {
  38. display = 'flex'
  39. width = 'var(--layout-tap)'
  40. height = 'var(--layout-tap)'
  41. minHeight = '0'
  42. marginLeft = 'auto'
  43. padding = '0'
  44. fontSize = '1.6rem'
  45. fontWeight = '400'
  46. lineHeight = '1'
  47. color = 'var(--color-text-muted)'
  48. @media {
  49. minWidth = '60rem'
  50. display = 'none'
  51. }
  52. }
  53. // No language form for slot elements absent from this View.
  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. // No language form for slot elements absent from this View.
  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. // No language form 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. // No language form for a selector list or the popover-open pseudo-class.
  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. // No language form for selector list, class on the component root.
  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

  • 35199303content-first: format Style with nested rules and bare mediamre
  • 00f6e698app-sidebar: format Style with nested rules and bare mediamre
  • bb2f29c9app-header: format Style with nested rules and bare mediamre
  • 3aca2d7fSync components from 8176eb1 with reviewed nested stylesmre
  • 87e4003dRe-vendor layouts to Hybriel set day35mre
  • d8628cfflayouts: a startup error prints its message before exit 1 (hybriel#247)mre
  • 180fd76elayouts: MdEditor from components 59704ce (text on the clipboard always pastes, a file manager copy still attaches; pipe rows; empty Table-button table; tickets#49, notes#5)mre
  • a3eda8afRe-vendor Hybriel master 7a684920 (binary 74ab3715): plugins whole, startup fault exits 1; files-upload gate 340/0mre
  • 025d5880WIP re-vendor Hybriel set-day27b (a9712e61, master f5ff97bf): plugins whole, startup fault exits 1; NOT deployable: files-upload emit refused (see .scratch/rv27-upload)mre
  • 42183a71Merge sb3-standby: layouts deploys through its standbymre
  • 408de1f2layouts: no jobs switch needed in the standbymre
  • 0b85f57elayouts: a standby container (port 45019, profile standby); deploy hands over through standby-swap.sh without a gapmre
  • 31e40b8bMerge dm3-media: range handling in the layouts media routemre
  • 856dcacbLayouts media route: read suffix ranges and ignore range lists and garbage, like the components route (the layouts copy still answered 416 for the last bytes)mre
  • ad5056eaMerge dm3-sync: components re-sync to c2834ddmre
  • 740e2abeRe-sync the components copy to c2834dd: media player fixes (state after a queue pick, cover-less audio, accessibility labels)mre
  • 7fe103bbMerge mp-player: the media player showcase pagemre
  • 7db43c4eMedia route: serve the showcase's media from committed files (storage/ is not in git)mre
  • f77b7d12Media player: re-sync components from 1c41293 (replay / forward 10 icons, play button surface on audio and video)mre
  • 40a9e69cMP: report, LOG linemre