gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitde964b3bde964b3bsettings: format Style with nested language rulesmrede964b3b/theme/shell/user-menu.hl

3.2 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. svg {
  23. width = '1.5rem'
  24. height = '1.5rem'
  25. }
  26. }
  27. '> nav:popover-open' {
  28. position = 'fixed'
  29. inset = 'var(--layout-header) max(var(--layout-gutter), calc((100% - var(--layout-column)) / 2)) auto auto'
  30. display = 'block'
  31. minWidth = '12rem'
  32. maxWidth = 'calc(100vw - 2 * var(--layout-gutter))'
  33. margin = '.25rem 0 0'
  34. padding = '.4rem'
  35. color = 'var(--color-text)'
  36. background = 'var(--color-surface)'
  37. border = '0'
  38. borderRadius = 'var(--radius-large)'
  39. boxShadow = '0 .75rem 2rem var(--color-background-sunken)'
  40. }
  41. 'p.who' {
  42. margin = '0'
  43. padding = '.4rem .6rem .5rem'
  44. fontSize = '.85rem'
  45. color = 'var(--color-text-muted)'
  46. overflow = 'hidden'
  47. textOverflow = 'ellipsis'
  48. whiteSpace = 'nowrap'
  49. empty { display = 'none' }
  50. }
  51. }
  52. // Keep the whole selector for selector list, :has condition.
  53. 'body:has(list-first) user-menu > nav:popover-open,
  54. body:has(three-pane) user-menu > nav:popover-open' { right = 'var(--layout-gutter)' }
  55. // Keep the whole selector for pseudo-element.
  56. 'user-menu > nav::backdrop' { background = 'transparent' }
  57. // Keep the whole selector for selector list.
  58. 'user-menu > nav a,
  59. user-menu > nav button' {
  60. display = 'flex'
  61. width = '100%'
  62. minHeight = 'var(--layout-tap)'
  63. alignItems = 'center'
  64. justifyContent = 'flex-start'
  65. padding = '.5rem .6rem'
  66. fontWeight = '600'
  67. color = 'var(--color-text)'
  68. borderRadius = 'var(--radius-small)'
  69. }
  70. // Keep the whole selector for selector list.
  71. 'user-menu > nav a:hover,
  72. user-menu > nav button:hover' {
  73. textDecoration = 'none'
  74. color = 'var(--color-text-strong)'
  75. background = 'var(--color-background)'
  76. }
  77. }
  78. View {
  79. userMenu {
  80. button { type = "button" class = "user-toggle" popovertarget = "user-menu" title = label 'aria-label' = label
  81. svg { viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" 'stroke-width' = "1.8" 'stroke-linecap' = "round" 'aria-hidden' = "true"
  82. circle { cx = "12" cy = "12" r = "10" }
  83. circle { cx = "12" cy = "10" r = "3.2" }
  84. path { d = "M6.2 18.6c1.4-2.2 3.4-3.3 5.8-3.3s4.4 1.1 5.8 3.3" }
  85. }
  86. }
  87. nav { id = "user-menu" popover = "auto" 'aria-label' = label on click(e) { emit userMenuClick(e) }
  88. p { class = "who" name }
  89. slot
  90. }
  91. }
  92. }
  93. // a tap on one of its links closes the dropdown (a page change in place would leave it open)
  94. on userMenuClick(e) {
  95. if (e.target.closest('a') != null) { e.currentTarget.hidePopover() }
  96. }

Branches

Latest commits

  • de964b3bsettings: format Style with nested language rulesmre
  • 03c1de05new_project: format Style with nested language rulesmre
  • bd76cfa6connect: format Style with nested language rulesmre
  • 01fad593inbox: format Style with nested language rulesmre
  • 79dc9392you: format Style with nested language rulesmre
  • 78073baamain: format Style with nested language rulesmre
  • 5499c290Sync theme unchanged from layouts 17e0f03mre
  • fd33ee21Sync reviewed components from 8176eb1mre
  • 93348453Re-vendor tickets to Hybriel set day35mre
  • a4123831tickets#42: the /connect and /login/callback error pages are app pages: the function routes redirect to /connect/failed/<code> and /login/failed/<code> (components/problem.hl, sentences in lib/problems.hl), htmlPage and its hand-written stylesheet are gone; gate tests/error-pages.mjsmre
  • cefc7b4atickets: a startup error prints its message before exit 1 (hybriel#247)mre
  • 99bd6570tickets: lib/migrate.hl writes no table of another topic any more: projects.hl rewriteSlug / addProjectNamed / hasMembers, tickets.hl moveToProject / ticketRecords / ticketRecordsOf, events.hl renameStates / eventRecords / eventRecordsOf; the migration calls them (tickets#47)mre
  • b57161e3tickets: the markup names its own rules (Style.pMessage, Style.olTickets, ...) instead of hand-written class strings that copy a stylesheet rule; the shared bodies sit in lib/looks.hl (tickets#38)mre
  • f767b24dtickets: 111 needless let became plain declarations (3 in ticket.hl, ticket_list.hl, comments.hl and 108 never-reassigned, not captured loop-body ones); the 212 really reassigned lets stay (tickets#44)mre
  • 16c0d3b5tickets: the modal window is phone first: the full-screen sheet is the base rule, the centred window sits in the min-width 60rem block (tickets#39)mre
  • 090ee809tickets: every component's styles in its own nested Style {} block; styles.hl keeps only the theme inherit, the accent and the site-wide rules (tickets#36)mre
  • d395763ftickets: ident-access gate ports 8769/8768 (8797 is taken on loreana)mre
  • afb9a403tickets: an ident access key (Authorization: Bearer idt_…) works in the API (ident#27 app side): lib/ident-access.hl copied from components, read keys GET only, ident down 503; gate tests/ident-access-tickets.mjsmre
  • 48c1ba79tickets: md-paste-files gate with the file manager casesmre
  • f04afc43tickets: MdEditor from components 59704ce (a file manager copy still attaches, pipe rows, tickets#49)mre