ident
All repositories: gitoria
3.0 KB
// 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// links the app puts in (last always Logout, before it Settings — creator, tracker#32) (docs/layouts/user-menu.md).// Signed out, the app puts its login (the ident selector) in the header INSTEAD of this component.//// AppHeader { … UserMenu { name = "az5b2" a { href = "/settings" "Settings" } a { href = "/logout" "Logout" } } }//// 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.String name = ''String label = 'User menu'slot = nullStyle {'user-menu' { display = 'block' flex = 'none' }'user-menu > button' { width = 'var(--layout-tap)' height = 'var(--layout-tap)' minHeight = '0' marginRight = '-.625rem' padding = '0' color = 'var(--color-text)' }'user-menu > button svg' { width = '1.5rem' height = '1.5rem' }'user-menu > nav:popover-open' { position = 'fixed' inset = 'var(--layout-header) max(var(--layout-gutter), calc((100% - var(--layout-column)) / 2)) auto auto' display = 'block' minWidth = '12rem' maxWidth = 'calc(100vw - 2 * var(--layout-gutter))' margin = '.25rem 0 0' padding = '.4rem' color = 'var(--color-text)' background = 'var(--color-surface)' border = '0' borderRadius = 'var(--radius-large)' boxShadow = '0 .75rem 2rem var(--color-background-sunken)' }'body:has(list-first) user-menu > nav:popover-open,body:has(three-pane) user-menu > nav:popover-open' { right = 'var(--layout-gutter)' }'user-menu > nav::backdrop' { background = 'transparent' }'user-menu p.who' { margin = '0' padding = '.4rem .6rem .5rem' fontSize = '.85rem' color = 'var(--color-text-muted)' overflow = 'hidden' textOverflow = 'ellipsis' whiteSpace = 'nowrap' }'user-menu p.who:empty' { display = 'none' }'user-menu > nav a,user-menu > nav button' { display = 'flex' width = '100%' minHeight = 'var(--layout-tap)' alignItems = 'center' justifyContent = 'flex-start' padding = '.5rem .6rem' fontWeight = '600' color = 'var(--color-text)' borderRadius = 'var(--radius-small)' }'user-menu > nav a:hover,user-menu > nav button:hover' { textDecoration = 'none' color = 'var(--color-text-strong)' background = 'var(--color-background)' }}View {userMenu {button { type = "button" class = "user-toggle" popovertarget = "user-menu" title = label 'aria-label' = labelsvg { viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" 'stroke-width' = "1.8" 'stroke-linecap' = "round" 'aria-hidden' = "true"circle { cx = "12" cy = "12" r = "10" }circle { cx = "12" cy = "10" r = "3.2" }path { d = "M6.2 18.6c1.4-2.2 3.4-3.3 5.8-3.3s4.4 1.1 5.8 3.3" }}}nav { id = "user-menu" popover = "auto" 'aria-label' = label on click(e) { emit userMenuClick(e) }p { class = "who" name }slot}}}// a tap on one of its links closes the dropdown (a page change in place would leave it open)on userMenuClick(e) {if (e.target.closest('a') != null) { e.currentTarget.hidePopover() }}
Branches
Latest commits
- eee0b513|||PR ident#34 part: test-hook classes replaced by name/element/attribute selectors (tests adjusted), the shared lead/message/notice looks are statics in styles.hlmre
- ccd6d0c4ident#34: browser gate: rowButton finds the row's button by namemre
- 24dd414eident#34: the shared lead, message and notice looks are statics in components/styles.hl, imported by the components (lib/looks.hl gone)mre
- 03ed26c7ident#34: access.hl: the remaining lead classes droppedmre
- 1d066c42ident#34: access.hl drops its unstyled lead class (the shared lead rule would otherwise mute it)mre
- 1e1dd7b4ident#34: the access page keeps its lead class string (the page has no ident-card, so its lead line was never muted; a shared rule would change the look)mre
- 89ac6553ident#34: the lead, message and notice lines are named with Style.pLead / pMessage / pNotice (shared bodies in lib/looks.hl) instead of class stringsmre
- e84be3deident#34: browser gate lists the Edit/Delete buttons by namemre
- fb7111faident#34: access page: unstyled test-hook classes (idrow, never, who, whoname, appname, neverrevoke) dropped; the tests use element/name selectorsmre
- 9f2ad803ident#34: notification switches: push/email by name=..., locked by aria-disabled, the switch look is the role=switch button (no switch/push/email/locked classes)mre
- e0f0ddaaident#34: inbox: the Mark read/unread button is styled as the button of its note-foot, the icon is found as the row's img (no toggle/icon classes)mre
- 16b49756ident#34: unused row classes (choice, usedrow, kind, shortid) droppedmre
- f9d6fb38ident#34: apps and identity rows: the Edit/New secret/Delete buttons carry name=..., the API key is found by its element; unused row classes (app, identity, shortid) droppedmre
- b323265aMerge branch 'f5-styles' into mainIdent
- 9ced53c3|||PR ident#33 ident#35 every component's styles live in its own Style block; styles.hl keeps the page-wide rest; the account bar is phone first (min-width: 60rem block); the avatar preview is hidden with the hidden attribute (ident#34 in part)mre
- f28333e4ident#33 ident#35: styles.hl keeps only the accent, the page column and the shared patterns; the account bar is written phone first (base rule + one min-width: 60rem block) instead of a max-width overridemre
- 5b4541fcident#33: the selector sign-in frame's rules move into embed.hl's Stylemre
- 00235f21ident#33: the per-app notification switches move into appsettings.hl's Stylemre
- 2249945cident#33: the inbox and connection list rules move into inbox.hl's Stylemre
- f2d9f79fident#33: the apps list and the secret box move into apps.hl's Stylemre