gitoria

gitoria

All repositories: gitoria

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

Branches

Latest commits

  • 55c84779Merge branch 'gp-gate-ports' into mainGitoria
  • 57af42bbREADME: point to deploy.sh for the port listmre
  • d63375d2README: gate commands with explicit portsmre
  • feeaa701|||PR gates: explicit ports only, deploy.sh passes themmre
  • 6cc1f943Merge branch 'records-1112' into mainGitoria
  • 9448c438|||PR records: LOG, missions and reports since 11-09mre
  • 6dc08a8eMerge branch 'p51-public-pr-reads' into mainGitoria
  • 7b88cfe0Type publicReaderOfRequest parameters (L10)Gitoria
  • 2a4b3dc1|||PR Anonymous reads of public repos' pulls and statusesmre
  • 21b2c141Merge branch 's25-no-session-on-login-error' into mainGitoria
  • 698458e2|||PR No session for cookieless login errors: READMEmre
  • cce7b785|||PR No session for cookieless login errorsmre
  • 678d6303Merge branch 'v59' into mainGitoria
  • 5803cf4f|||PR vendor: Hybriel set-day59 and GC budget 32 MiBmre
  • 9eff6627Merge branch 'f2-api-bugs' into mainGitoria
  • 26117255|||PR apps API: review comments on files with spaces in their namemre
  • b8796cecMerge branch 'f1-broken-json' into mainGitoria
  • 2f2959c5|||PR apps API: broken JSON body gives 400 invalid_json, not 500mre
  • f7c6ca07Merge branch 'ident-chooser-selector' into mainGitoria
  • 691abb8e|||PR tests: find ident identity choice without the removed .choose classmre