ident
All repositories: gitoria
11.8 KB
// styles.hl — ALL of the app's CSS, served as /__hl/app.css. Components carry no Style// blocks: markup is domain tags (<ident-card>, <app-request>, …), this file lays them out.//// TOKENS (ticket antcolony#3, mission 021): the WorldAPI palette + semantic tokens are declared in// `shared/tokens.hl` as hl:web css variables (`static colorText = var(light)`), hand-written, a// verbatim copy of loreana /media/STORAGE/projects/worldapi-tokens/tokens.hl (vendored like// plugins/; edit it THERE and cp it here). This file IMPORTS the tokens it uses and writes them as// members (`color = colorText`, `border = '1px solid ' + colorBorder`); hl:web names each token// after its member (--color-text), writes all of tokens.hl's tokens into the one :root and every// use as var(--color-text). The app sets only its accent (`colorAccent = var(…)` below, written// after the default, so it wins). hl:web does this itself since hybriel#39 (the mission-021 patch is gone).//// In a styles file a bare name is a TAG (camelCase → kebab: `identCard` is// `ident-card`), a quoted name is a selector written verbatim. MOBILE FIRST: every// rule is the phone's; the one min-width block adds the wide layout.import { var } from 'hl:web/css'import { orange, colorText, colorBackground, colorTextStrong, colorBackgroundSunken, colorTextMuted, colorAccentText, colorBorder, colorDanger, colorSurface, colorSuccess, colorWarning } from './shared/tokens.hl'colorAccent = var(orange) // the app's accent: the only token this app sets'*,*::before,*::after' { boxSizing = 'border-box' }html { colorScheme = 'dark' }body { margin = '0' font = '16px/1.5 system-ui, sans-serif' color = colorText background = colorBackground }a { color = colorAccent textDecoration = 'none' }'a:hover' { textDecoration = 'underline' }h1 { margin = '0' fontSize = '1.3rem' lineHeight = '1.3' color = colorTextStrong }h2 { margin = '0' fontSize = '1.1rem' lineHeight = '1.3' color = colorTextStrong }strong { color = colorTextStrong overflowWrap = 'anywhere' }input { font = 'inherit' width = '100%' padding = '.55rem .7rem' color = colorTextStrong background = colorBackgroundSunken border = '1px solid ' + colorBorder borderRadius = '.4rem' }'input:focus' { outline = '2px solid ' + colorAccent outlineOffset = '1px' }'#code' { fontSize = '1.4rem' letterSpacing = '.3em' fontVariantNumeric = 'tabular-nums' }label { display = 'grid' gap = '.25rem' fontSize = '.9rem' color = colorTextMuted }'button,a.button' { display = 'inline-block' font = 'inherit' fontWeight = '600' padding = '.6rem 1.1rem' color = colorAccentText background = colorAccent border = '1px solid ' + colorAccent borderRadius = '.4rem' cursor = 'pointer' justifySelf = 'start' textAlign = 'center' }'button:hover,a.button:hover' { filter = 'brightness(1.1)' textDecoration = 'none' }'button.quiet' { color = colorText background = 'transparent' borderColor = colorBorder }'button.small' { padding = '.3rem .7rem' fontSize = '.9rem' }'button.danger' { color = colorDanger borderColor = colorDanger }// ---- the shell ---------------------------------------------------------------------------applicationHeader { display = 'flex' flexWrap = 'wrap' alignItems = 'baseline' gap = '.2rem 1rem' padding = '.6rem 1rem' background = colorBackgroundSunken borderBottom = '1px solid ' + colorBorder }'application-header .brand' { fontWeight = '800' fontSize = '1.15rem' color = colorAccent }'application-header .tagline' { color = colorTextMuted fontSize = '.85rem' }main { padding = '1rem' }// ---- the card (login and signed in) ------------------------------------------------------------------------identCard { display = 'grid' gap = '1rem' maxWidth = '34rem' margin = '0 auto' padding = '1.2rem 1rem' background = colorSurface border = '1px solid ' + colorBorder borderRadius = '.6rem' }'ident-card p' { margin = '0' }'ident-card form' { display = 'grid' gap = '.8rem' }'ident-card .lead' { color = colorTextMuted fontSize = '.95rem' }userEmail { display = 'block' color = colorTextMuted fontSize = '.9rem' overflowWrap = 'anywhere' }formButtons { display = 'flex' flexWrap = 'wrap' gap = '.5rem' }'.message' { margin = '0' minHeight = '1.5em' color = colorDanger }'.notice' { margin = '0' color = colorSuccess }'.notice:empty' { display = 'none' }fieldHint { color = colorTextMuted fontSize = '.8rem' }// ---- signed in: account bar, identities, time zone -----------------------------------------accountBar { display = 'flex' flexWrap = 'wrap' alignItems = 'center' justifyContent = 'space-between' gap = '.5rem' paddingBottom = '.8rem' borderBottom = '1px solid ' + colorBorder }'account-bar user-email' { fontSize = '.95rem' }'ident-card section' { display = 'grid' gap = '.8rem' }sectionHead { display = 'flex' flexWrap = 'wrap' alignItems = 'center' justifyContent = 'space-between' gap = '.5rem' }'#identities' { listStyle = 'none' margin = '0' padding = '0' display = 'grid' gap = '.5rem' }'#identities li' { display = 'flex' flexWrap = 'wrap' alignItems = 'center' justifyContent = 'space-between' gap = '.5rem' padding = '.7rem .8rem' background = colorBackgroundSunken border = '1px solid ' + colorBorder borderRadius = '.4rem' }identityMain { flex = '1 1 12rem' display = 'flex' flexWrap = 'wrap' alignItems = 'baseline' gap = '.2rem .5rem' minWidth = '0' }identityLabel { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }identityShortId { fontFamily = 'ui-monospace, monospace' fontSize = '.85rem' color = colorTextMuted letterSpacing = '.08em' userSelect = 'all' }defaultBadge { fontSize = '.75rem' padding = '0 .4rem' color = colorAccent border = '1px solid ' + colorAccent borderRadius = '1rem' }identityDetails { flexBasis = '100%' color = colorTextMuted fontSize = '.9rem' overflowWrap = 'anywhere' }identityActions { display = 'flex' gap = '.4rem' }'#identities img.avatar, #chooselist img.avatar' { flex = '0 0 auto' width = '32px' height = '32px' objectFit = 'cover' borderRadius = '50%' background = colorSurface }'#identityform' { padding = '1rem' border = '1px solid ' + colorAccent borderRadius = '.5rem' }'#avatarpreview' { width = '48px' height = '48px' objectFit = 'cover' borderRadius = '50%' background = colorSurface }'#avatarpreview.hidden, #avatarremove.hidden' { display = 'none' }avatarField { display = 'flex' flexWrap = 'wrap' alignItems = 'center' gap = '.6rem' }'.avatar-note' { flexBasis = '100%' color = colorDanger fontSize = '.85rem' }'.avatar-note:empty' { display = 'none' }'#timezonesection' { paddingTop = '.8rem' borderTop = '1px solid ' + colorBorder }'application-header nav' { display = 'flex' gap = '1rem' marginLeft = 'auto' fontSize = '.95rem' }// ---- the login button: the app's request and the identity choice ------------------------appRequest { display = 'block' padding = '.6rem .8rem' color = colorText background = colorBackgroundSunken borderLeft = '3px solid ' + colorAccent borderRadius = '.3rem' overflowWrap = 'anywhere' }requestOrigin { display = 'block' color = colorTextMuted fontSize = '.85rem' }'#chooselist' { listStyle = 'none' margin = '0' padding = '0' display = 'grid' gap = '.5rem' }'#chooselist li' { display = 'flex' flexWrap = 'wrap' alignItems = 'center' justifyContent = 'space-between' gap = '.5rem' padding = '.7rem .8rem' background = colorBackgroundSunken border = '1px solid ' + colorBorder borderRadius = '.4rem' }// ---- apps ----------------------------------------------------------------------------------'#apps' { listStyle = 'none' margin = '0' padding = '0' display = 'grid' gap = '.5rem' }'#apps li' { display = 'flex' flexWrap = 'wrap' alignItems = 'center' justifyContent = 'space-between' gap = '.5rem' padding = '.7rem .8rem' background = colorBackgroundSunken border = '1px solid ' + colorBorder borderRadius = '.4rem' }appMain { flex = '1 1 14rem' display = 'grid' gap = '.15rem' minWidth = '0' }appName { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }appOrigins { color = colorTextMuted fontSize = '.9rem' overflowWrap = 'anywhere' }appKey { fontSize = '.85rem' color = colorTextMuted overflowWrap = 'anywhere' }code { fontFamily = 'ui-monospace, monospace' fontSize = '.85rem' color = colorTextStrong overflowWrap = 'anywhere' wordBreak = 'break-all' }secretBox { display = 'grid' gap = '.6rem' padding = '1rem' border = '1px solid ' + colorWarning borderRadius = '.5rem' }'secret-box code' { display = 'block' padding = '.5rem .6rem' background = colorBackgroundSunken borderRadius = '.3rem' userSelect = 'all' }'#appform' { padding = '1rem' border = '1px solid ' + colorAccent borderRadius = '.5rem' }// ---- notifications: the inbox and the per-app page (piece 4) --------------------------------'ident-card.wide' { maxWidth = '46rem' }unreadTotal { color = colorAccent fontSize = '.9rem' fontWeight = '600' }'#inbox,#conns,#kinds' { listStyle = 'none' margin = '0' padding = '0' display = 'grid' gap = '.5rem' }'#inbox li' { display = 'flex' alignItems = 'flex-start' gap = '.7rem' padding = '.7rem .8rem' background = colorBackgroundSunken border = '1px solid ' + colorBorder borderRadius = '.4rem' }'#inbox li.unread' { borderLeft = '3px solid ' + colorAccent }'#inbox li.read' { opacity = '.75' }'#inbox img.icon' { flex = '0 0 auto' width = '40px' height = '40px' objectFit = 'cover' borderRadius = '.3rem' background = colorSurface }noteMain { flex = '1 1 auto' display = 'grid' gap = '.25rem' minWidth = '0' }noteHead { display = 'flex' flexWrap = 'wrap' alignItems = 'baseline' gap = '.2rem .5rem' }noteName { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }urgentBadge { fontSize = '.75rem' padding = '0 .4rem' color = colorDanger border = '1px solid ' + colorDanger borderRadius = '1rem' }unreadBadge { fontSize = '.75rem' padding = '0 .4rem' color = colorAccent border = '1px solid ' + colorAccent borderRadius = '1rem' }noteFrom { color = colorTextMuted fontSize = '.85rem' overflowWrap = 'anywhere' }noteText { whiteSpace = 'pre-wrap' overflowWrap = 'anywhere' }noteFoot { display = 'flex' flexWrap = 'wrap' alignItems = 'center' gap = '.4rem .8rem' color = colorTextMuted fontSize = '.85rem' }'note-foot .toggle' { marginLeft = 'auto' }'#connsection,#kindssection,#overridesection' { paddingTop = '.8rem' borderTop = '1px solid ' + colorBorder }'#conns li,#kinds li' { display = 'flex' flexWrap = 'wrap' alignItems = 'center' justifyContent = 'space-between' gap = '.5rem' padding = '.7rem .8rem' background = colorBackgroundSunken border = '1px solid ' + colorBorder borderRadius = '.4rem' }'#conns a.conn' { fontWeight = '700' overflowWrap = 'anywhere' }connDetails { color = colorTextMuted fontSize = '.9rem' overflowWrap = 'anywhere' }kindMain { flex = '1 1 12rem' display = 'grid' gap = '.15rem' minWidth = '0' }kindName { fontWeight = '700' color = colorTextStrong overflowWrap = 'anywhere' }kindPreset { color = colorTextMuted fontSize = '.85rem' overflowWrap = 'anywhere' }kindSwitches { display = 'flex' gap = '1rem' }switchRow { display = 'flex' alignItems = 'center' gap = '.5rem' }switchLabel { fontSize = '.9rem' color = colorTextMuted }'button.switch' { minWidth = '3.6rem' padding = '.25rem .6rem' fontSize = '.85rem' color = colorText background = 'transparent' borderColor = colorBorder }'button.switch[aria-checked="true"]' { color = colorAccentText background = colorAccent borderColor = colorAccent }'button.switch.locked' { opacity = '.45' cursor = 'not-allowed' }switchOff { display = 'inline-block' minWidth = '3.6rem' textAlign = 'center' color = colorTextMuted }'#overridesection switch-row' { justifyContent = 'space-between' maxWidth = '16rem' }'@media (min-width: 40rem)' = {main = { padding = '3rem 1rem' }'ident-card' = { padding = '1.8rem 2rem' }h1 = { fontSize = '1.5rem' }}
Branches
- mainmain branch