gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit97110ad997110ad9WIP: nest accepted layout selectors; stopped at startup parse failuremre97110ad9/theme/shell/app-sidebar.hl

4.0 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 nested form for this functional/popup pseudo on day44 (v08/v11).
  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. // Keep the whole selector for pseudo-element.
  32. // No nested pseudo-element form on day44 (probes v09/v10; hybriel#344/#345/#260).
  33. 'app-sidebar::backdrop' {
  34. background = 'var(--color-background-sunken)'
  35. opacity = '.7'
  36. }
  37. appSidebar {
  38. // No unquoted child/sibling combinator form; keep exact selector (probe v18).
  39. '> button.sidebar-close' {
  40. display = 'flex'
  41. width = 'var(--layout-tap)'
  42. height = 'var(--layout-tap)'
  43. minHeight = '0'
  44. marginLeft = 'auto'
  45. padding = '0'
  46. fontSize = '1.6rem'
  47. fontWeight = '400'
  48. lineHeight = '1'
  49. color = 'var(--color-text-muted)'
  50. @media {
  51. minWidth = '60rem'
  52. display = 'none'
  53. }
  54. }
  55. }
  56. // Keep the whole selector for selector list.
  57. // No nested attribute-selector form on day44 (probes v05/v06).
  58. 'app-sidebar nav a.current,
  59. app-sidebar nav a[aria-current="page"]' {
  60. color = 'var(--color-accent)'
  61. background = 'var(--color-surface)'
  62. }
  63. // Keep the whole selector for selector list.
  64. // No nested form for this functional/popup pseudo on day44 (v08/v11).
  65. 'app-sidebar,
  66. app-sidebar:popover-open' {
  67. @media {
  68. minWidth = '60rem'
  69. position = 'static'
  70. inset = 'auto'
  71. display = 'block'
  72. width = 'auto'
  73. height = 'auto'
  74. margin = '0'
  75. padding = '0'
  76. overflow = 'visible'
  77. color = 'inherit'
  78. background = 'transparent'
  79. border = '0'
  80. }
  81. }
  82. // Keep the whole selector for selector list.
  83. // No nested form for this functional/popup pseudo on day44 (v08/v11).
  84. 'app-sidebar.mobile-only,
  85. app-sidebar.mobile-only:popover-open' {
  86. @media {
  87. minWidth = '60rem'
  88. display = 'none'
  89. }
  90. }
  91. // Caller slot content is unknown here, so its selectors must be whole.
  92. // Caller slot content must keep whole selectors (layouts#8; probe v23).
  93. 'app-sidebar h2' {
  94. margin = '1rem 0 .35rem'
  95. padding = '0 .75rem'
  96. fontSize = '.8rem'
  97. fontWeight = '700'
  98. letterSpacing = '.04em'
  99. textTransform = 'uppercase'
  100. color = 'var(--color-text-muted)'
  101. }
  102. // Ancestor context is outside this View; retain whole selector (hybriel#243; v23).
  103. 'app-sidebar nav a' {
  104. display = 'flex'
  105. alignItems = 'center'
  106. minHeight = 'var(--layout-tap)'
  107. padding = '.45rem .75rem'
  108. color = 'var(--color-text)'
  109. borderRadius = 'var(--radius-small)'
  110. }
  111. // Ancestor context is outside this View; retain whole selector (hybriel#243; v23).
  112. 'app-sidebar nav a:hover' {
  113. textDecoration = 'none'
  114. color = 'var(--color-text-strong)'
  115. background = 'var(--color-surface)'
  116. }
  117. }
  118. View {
  119. appSidebar { id = "sidebar" class = cls popover = "auto" on click(e) { emit sidebarClick(e) }
  120. button { type = "button" class = "sidebar-close" popovertarget = "sidebar" popovertargetaction = "hide" title = closeLabel 'aria-label' = closeLabel "×" }
  121. slot
  122. }
  123. }
  124. // a tap on a link inside the open overlay closes it (a page change in place would leave it open)
  125. on sidebarClick(e) {
  126. if (e.target.closest('a') != null && e.currentTarget.matches(':popover-open')) { e.currentTarget.hidePopover() }
  127. }

Branches

Latest commits

  • 97110ad9WIP: nest accepted layout selectors; stopped at startup parse failuremre
  • ce4a0baeKeep caller slot styles whole so minimal shell apps startmre
  • 12cd3992Re-vendor complete Hybriel plugins and runtime to day44mre
  • b05c20feBackup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
  • 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