gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit8d9ed0b88d9ed0b8Re-vendor complete Hybriel plugins and runtime to day39mre8d9ed0b8/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. h2 {
  53. margin = '1rem 0 .35rem'
  54. padding = '0 .75rem'
  55. fontSize = '.8rem'
  56. fontWeight = '700'
  57. letterSpacing = '.04em'
  58. textTransform = 'uppercase'
  59. color = 'var(--color-text-muted)'
  60. }
  61. nav {
  62. a {
  63. display = 'flex'
  64. alignItems = 'center'
  65. minHeight = 'var(--layout-tap)'
  66. padding = '.45rem .75rem'
  67. color = 'var(--color-text)'
  68. borderRadius = 'var(--radius-small)'
  69. hover {
  70. textDecoration = 'none'
  71. color = 'var(--color-text-strong)'
  72. background = 'var(--color-surface)'
  73. }
  74. }
  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

  • 8d9ed0b8Re-vendor complete Hybriel plugins and runtime to day39mre
  • ebd00b6cNest caller slot styles in three-panemre
  • 009991efNest caller slot styles in list-firstmre
  • 494d75d4Nest caller slot styles in app-sidebarmre
  • e5571680Align all plugin sources with Hybriel day38bmre
  • 5d204c46Re-vendor layouts to Hybriel set day38bmre
  • 17e0f03eNest html-prefixed theme component overridesmre
  • e54e735eFormat plain theme elements with nested rules and bare mediamre
  • 547f834eRecord LY7 deployment and live verificationmre
  • fa4600b1Link caller-slot style exceptions to hybriel#270mre
  • 413b11e1Record corrected LY7 nesting, exact CSS and Chrome proofmre
  • b810453etracker-demo: nest child and compound selectors in Stylemre
  • 0b5b1d61notes-demo: nest child and compound selectors in Stylemre
  • ab22bdc2mail-demo: nest child and compound selectors in Stylemre
  • fe2d8de9home: nest child and compound selectors in Stylemre
  • e631791buser-menu: nest child and compound selectors in Stylemre
  • 69604944three-pane: nest child and compound selectors in Stylemre
  • 3e389b83main-menu: nest child and compound selectors in Stylemre
  • 05413975list-first: nest child and compound selectors in Stylemre
  • c545b642content-first: nest child and compound selectors in Stylemre