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
- 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
- dc97ec0dident#34: the Notif. chip and the Used in link share chipLook (Style.pChip) instead of the classes chip/used/notifmre
- 378bd432ident#34: the identity picture look is a static in styles.hl (Style.pAvatar); sizes stay with each listmre
- 1cf79e7eident#34: the wide page column is a static in styles.hl (Style.pWide), not the class "wide"mre
- ddc7d135Merge branch 'f7-hooks' into mainIdent
- 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