gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit88e1d14d88e1d14d|||PR layouts#9: address Kunibert findings (3-pane 768px, :where invalid focus, placeholder & glow contrast)Atlas88e1d14d/theme/shell/user-menu.hl

3.3 KB

  1. // user-menu.hl — THE USER MENU: one icon at the header's right end; a tap opens a dropdown with the signed-in name and the
  2. // links the app puts in (last always Logout, before it Settings — creator, tracker#32) (docs/layouts/user-menu.md).
  3. // Signed out, the app puts its login (the ident selector) in the header INSTEAD of this component.
  4. //
  5. // AppHeader { … UserMenu { name = "az5b2" a { href = "/settings" "Settings" } a { href = "/logout" "Logout" } } }
  6. //
  7. // The dropdown is the browser's popover `#user-menu`: Esc and a tap outside close it, and so does a tap on one of its links.
  8. String name = ''
  9. String label = 'User menu'
  10. slot = null
  11. Style {
  12. userMenu {
  13. display = 'block'
  14. flex = 'none'
  15. '> button' {
  16. width = 'var(--layout-tap)'
  17. height = 'var(--layout-tap)'
  18. minHeight = '0'
  19. marginRight = '-.625rem'
  20. padding = '0'
  21. color = 'var(--color-text)'
  22. background = 'transparent'
  23. hover { background = 'var(--color-surface)' }
  24. svg {
  25. width = '1.5rem'
  26. height = '1.5rem'
  27. }
  28. }
  29. '> nav:popover-open' {
  30. position = 'fixed'
  31. inset = 'var(--layout-header) max(var(--layout-gutter), calc((100% - var(--layout-column)) / 2)) auto auto'
  32. display = 'block'
  33. minWidth = '12rem'
  34. maxWidth = 'calc(100vw - 2 * var(--layout-gutter))'
  35. margin = '.25rem 0 0'
  36. padding = '.4rem'
  37. color = 'var(--color-text)'
  38. background = 'var(--color-surface)'
  39. border = '0'
  40. borderRadius = 'var(--radius-large)'
  41. boxShadow = '0 .75rem 2rem var(--color-background-sunken)'
  42. }
  43. 'p.who' {
  44. margin = '0'
  45. padding = '.4rem .6rem .5rem'
  46. fontSize = '.85rem'
  47. color = 'var(--color-text-muted)'
  48. overflow = 'hidden'
  49. textOverflow = 'ellipsis'
  50. whiteSpace = 'nowrap'
  51. empty { display = 'none' }
  52. }
  53. }
  54. // Keep the whole selector for selector list, :has condition.
  55. 'body:has(list-first) user-menu > nav:popover-open,
  56. body:has(three-pane) user-menu > nav:popover-open' { right = 'var(--layout-gutter)' }
  57. // Keep the whole selector for pseudo-element.
  58. 'user-menu > nav::backdrop' { background = 'transparent' }
  59. // Keep the whole selector for selector list.
  60. 'user-menu > nav a,
  61. user-menu > nav button' {
  62. display = 'flex'
  63. width = '100%'
  64. minHeight = 'var(--layout-tap)'
  65. alignItems = 'center'
  66. justifyContent = 'flex-start'
  67. padding = '.5rem .6rem'
  68. fontWeight = '600'
  69. color = 'var(--color-text)'
  70. background = 'transparent'
  71. borderRadius = 'var(--radius-small)'
  72. }
  73. // Keep the whole selector for selector list.
  74. 'user-menu > nav a:hover,
  75. user-menu > nav button:hover' {
  76. textDecoration = 'none'
  77. color = 'var(--color-text-strong)'
  78. background = 'var(--color-background)'
  79. }
  80. }
  81. View {
  82. userMenu {
  83. button { type = "button" class = "user-toggle" popovertarget = "user-menu" title = label 'aria-label' = label
  84. svg { viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" 'stroke-width' = "1.8" 'stroke-linecap' = "round" 'aria-hidden' = "true"
  85. circle { cx = "12" cy = "12" r = "10" }
  86. circle { cx = "12" cy = "10" r = "3.2" }
  87. path { d = "M6.2 18.6c1.4-2.2 3.4-3.3 5.8-3.3s4.4 1.1 5.8 3.3" }
  88. }
  89. }
  90. nav { id = "user-menu" popover = "auto" 'aria-label' = label on click(e) { emit userMenuClick(e) }
  91. p { class = "who" name }
  92. slot
  93. }
  94. }
  95. }
  96. // a tap on one of its links closes the dropdown (a page change in place would leave it open)
  97. on userMenuClick(e) {
  98. if (e.target.closest('a') != null) { e.currentTarget.hidePopover() }
  99. }

Branches

Latest commits

  • 88e1d14d|||PR layouts#9: address Kunibert findings (3-pane 768px, :where invalid focus, placeholder & glow contrast)Atlas
  • 8c875a78|||PR layouts#9: match HyperConductor look (lines 1-21)Atlas
  • 4099e64aMerge branch 'font-segoe-ui' into mainAtlas
  • e14fb795|||PR Theme font: Segoe UI first (his choice 2026-11-19)Atlas
  • 44071d2cMerge branch 'hl-standard-5' into mainAtlas
  • 5ea64202|||PR Gate: count the new-tab check's console errors tooAtlas
  • 2752ceddMerge branch 'hl-standard-4' into mainAtlas
  • ac552b81|||PR Gate: keyboard (Tab/Enter/Space) and Back/Forward/reload/new-tab checks (HL-STANDARD F5, F21)Atlas
  • 8cddcaa9Merge branch 'hl-standard-2' into mainAtlas
  • 2b480a64|||PR Type the route parameter of main-menu build (HL-STANDARD L10)Atlas
  • ab54a39dMerge branch 'hl-standard' into mainAtlas
  • 04d36fcf|||PR Type function parameters and drop unneeded let (HL-STANDARD L2, L10)Atlas
  • 220c8fa4Merge branch 'readme-audit' into mainAtlas
  • b78fb85a|||PR README matches the codemre
  • 9f351699Preserve comments and nest supported selectors without changing rendered outputmre
  • 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