ident
All repositories: gitoria
6.1 KB
// styles.hl — the app's CSS, served as /__hl/app.css. It INHERITS THE WORLDAPI THEME (theme/theme.hl, copied verbatim from// layouts.worldapi.org dbe3de7 — never edited here; docs: layouts docs/using-the-theme.md) and keeps only what is page-wide:// the app accent, the page column every page sits in, and the patterns several components share (form lines and buttons, the// account bar, the lists of rows, the form cards). Every component's own look is in its own Style block (ident#33).//// TOKENS: colours only through the named tokens (shared/tokens.hl = layouts' file, byte-equal); the app sets only its accent// (orange). Corners: radiusSmall (5px) / radiusLarge (10px: panels, rows). Borderless — `node theme/check-theme.mjs .` must// report 0 problems (a deploy gate).// In a styles file a bare name is a TAG (camelCase → kebab), a quoted name is a selector written verbatim; a selector the theme// already writes may not be written again (hl:web refuses it) — so the theme's own elements are NOT repeated here.// PHONE FIRST: every rule outside a block is the phone's (390 px); the `@media` blocks only ADD the wide layout (from 60rem,// the theme's breakpoint).inherit '../theme/theme.hl'import { var } from 'hl:web/css'import { orange, colorBackgroundSunken, colorTextStrong, colorTextMuted, colorDanger, colorSuccess, colorSurface } from '../shared/tokens.hl'colorAccent = var(orange) // the app's accent: the only token this app sets// ---- looks several components share: a component names one in its own Style (`pLead = leadLook`) and writes `Style.pLead` ----// (hybriel#253: Style.x does not find a rule of this file, so the body is a static the component imports.)static leadLook = {color = colorTextMuted}static messageLook = {margin = '0'minHeight = '1.5em'color = colorDanger}static noticeLook = {margin = '0'color = colorSuccessempty {display = 'none'}}// the wide pages (inbox, per-app settings, identity page) name it: `pWide = wideLook`, `identCard { Style.pWide`static wideLook = {maxWidth = '46rem'}// the round picture of an identity (identity row, choice list, identity page): the size stays with each liststatic avatarLook = {flex = '0 0 auto'objectFit = 'cover'borderRadius = '50%'background = colorBackgroundSunken}// the small tap-sized link look: the "Notif." chip (identity page) and the "Used in…" link (identities list)static chipLook = {display = 'inline-flex'alignItems = 'center'justifyContent = 'center'minHeight = 'var(--layout-tap)'minWidth = 'var(--layout-tap)'padding = '0 .8rem'fontSize = '.875rem'background = colorBackgroundSunkenborderRadius = 'var(--radius-small)'}// ---- the page column (every page, signed in or out): centred, no panel ----------------------------------------------------identCard {display = 'grid'gap = '1rem'maxWidth = '34rem'margin = '0 auto'}'ident-card h1,ident-card h2,ident-card p' {margin = '0'}'ident-card form' {display = 'grid'gap = '.8rem'}'ident-card label' {display = 'grid'gap = '.25rem'marginBottom = '0'}'ident-card section' {display = 'grid'gap = '.8rem'}@media {minWidth = '60rem'identCard {gap = '1.2rem'}}// ---- shared by several components: form lines, the status lines, section heads -----------------------------------------------formButtons {display = 'flex'flexWrap = 'wrap'gap = '.5rem'}fieldHint {color = colorTextMutedfontSize = '.875rem'fontWeight = '400'}sectionHead {display = 'flex'flexWrap = 'wrap'alignItems = 'center'justifyContent = 'space-between'gap = '.5rem'}code {fontFamily = 'ui-monospace, monospace'fontSize = '.875rem'color = colorTextStrongoverflowWrap = 'anywhere'wordBreak = 'break-all'}// ---- signed in: the account bar of apps, inbox and per-app settings -------------------------------------------------------------// The user menu (header, a popover over the top right) carries the email, Sign out and Sign out everywhere on every page. On a PHONE the// account bar keeps only the page's own link, at the LEFT — the open menu then covers nothing of the page (tests/mobile.mjs); from 60rem// the address shows and the link goes to the right (ident#35: the phone is the base, the wide layout is added)accountBar {display = 'flex'flexWrap = 'wrap'alignItems = 'center'justifyContent = 'flex-start'gap = '.25rem .5rem'}'account-bar a' {display = 'inline-flex'alignItems = 'center'minHeight = 'var(--layout-tap)'minWidth = 'var(--layout-tap)'justifyContent = 'center'}userEmail {display = 'none'color = colorTextMutedfontSize = '.875rem'overflowWrap = 'anywhere'}@media {minWidth = '60rem'accountBar {justifyContent = 'space-between'}userEmail {display = 'block'}}// ---- the lists of rows (identities, used in, choice, apps, inbox, connections, kinds): one pattern; each component adds its own parts'#identities,#usedin,#chooselist,#apps,#inbox,#conns,#kinds' {listStyle = 'none'margin = '0'padding = '0'display = 'grid'gap = '.5rem'}'#identities li,#usedin li,#chooselist li,#apps li,#inbox li,#conns li,#kinds li' {display = 'flex'flexWrap = 'wrap'alignItems = 'center'justifyContent = 'space-between'gap = '.5rem'margin = '0'padding = '.7rem .8rem'background = colorSurfaceborderRadius = radiusLarge}// ---- the form cards (the identity form and the app form) --------------------------------------------------------------------------'#identityform,#appform' {display = 'grid'gap = '.8rem'padding = '1rem'background = colorSurfaceborderRadius = radiusLarge}'#identityform input,#appform input' {background = colorBackgroundSunken}// every grid item may shrink (a wide field pushed the form past the screen)'#identityform > *,#appform > *' {minWidth = '0'}// the brand link of the theme's header is 43 px wide at 390 (the tap minimum is 44 × 44): a minimum width, here, because the theme// is never edited in an app'html application-header > a.brand' {minWidth = 'var(--layout-tap)' // (html + > : outranks the theme's own `application-header > a.brand { min-width: 0 }`; real Chrome measured it 43 px)}
Branches
Latest commits
- 2a99730a|||PR ident#37 avatar in hlmre
- fa4ed25bMerge branch 'f11-upsert' into mainIdent
- 8f3d9bc9|||PR ident#42 keyed upsert and removemre
- 675493b1ident#42: editing an identity upserts the one edited row (face editIdentity answers { identity, row }); a create or delete keeps the whole list because the rows' position-dependent parts (default, Delete, Identity n) changemre
- 45e55303ident#42: an app write patches one row: upsert on create, edit and new secret, one-argument remove on delete; the faces answer the changed app (or the deleted id), not the whole listmre
- 991641d4Merge branch 'f10-access' into mainIdent
- e56d8273|||PR ident#34 part 4: access and inbox fixed classesmre
- df7696dbident#34: tests: access ticks selector quoting fixmre
- 7215903eident#34: access: the unstyled classes all, app, tick, apptick, plus are dropped; the gate finds the app ticks by input[name=app]mre
- 69b0a0ceident#34: access: the pick buttons use Style.pickCard instead of class pickmre
- dc702419Merge branch 'f9-choose' into mainIdent
- 8caec771|||PR ident#34 restore .choose hookmre
- 0dbff960Merge branch 'f8-shared' into mainIdent
- d69665f6|||PR ident#34 part 3: shared look classes (wide, avatar, chip/used, conn, choose, who, inboxlink) moved to statics or droppedmre
- 3a64dc48ident#34: chipLook: radius as the same var() string (a bare token name in a static does not compile); selector gate selectormre
- eb039073ident#34: tests: signin and migration find the choice without the classmre
- 4b94a594ident#34: tests: fix selector of the identity choicemre
- bebc88e4ident#34: main.hl drops the unstyled classes inboxlink and whomre
- b4e7ad04ident#34: the identity choice link/button has no class (rule on #chooselist a)mre
- 3c33d6eaident#34: the connection link in inbox has no class (rule on #conns a)mre