tickets
All repositories: gitoria
16.4 KB
// theme/theme.hl — THE WORLDAPI THEME: how WorldAPI makes the black/white components of components.hybriel.worldapi.org// look for itself. A styles file (hl:web): an app inherits it from its own styles.hl and sets its accent and type colours://// inherit './theme/theme.hl'// import { var } from 'hl:web/css'// import { purple, yellow } from './shared/tokens.hl'// colorAccent = var(purple)// colorType1 = var(yellow)//// What is in here, in this order:// 1. layout tokens and the type-colour slots (the palette and the semantic roles are shared/tokens.hl)// 2. plain HTML elements: text, links, buttons, fields, foldables, drop zones, tables, pills// 3. the components of components.hybriel.worldapi.org, themed WITHOUT forking them: every rule repeats the component's// own selector with `html ` in front, so it wins over the component's Style (which comes later in the one stylesheet)// and never emits the same selector twice (hl:web refuses that)// The shells (header, sidebar, content-first, list-first, three-pane) carry their own Style in theme/shell/*.hl.//// Design rules (docs/design-rules.md): borderless — a border only where it means something (foldables, drop zones,// focus); no boxed cards, no grey frames; colours only through the named tokens; titles white; mobile first, wider// layouts in `@media (min-width: 60rem)` (the one breakpoint of the theme, also used by theme/shell/*.hl).import { var } from 'hl:web/css'import { yellow, greenDark, purple, blueDark, orange, blueLight, colorBackground, colorBackgroundSunken, colorSurface, colorBorder, colorText, colorTextStrong, colorTextMuted, colorSuccess, colorWarning, colorDanger, colorAccent, colorAccentText } from '../shared/tokens.hl'// ---- 1. tokens -------------------------------------------------------------------------------------------------// the type colours: an app names what each slot means (tracker: 1 Movie, 2 Series, 3 Show, 4 Genre, 5 Person) and may// point a slot at another palette colour in its styles.hl (`colorType1 = var(yellow)`)colorType1 = var(yellow)colorType2 = var(greenDark)colorType3 = var(purple)colorType4 = var(blueDark)colorType5 = var(orange)colorType6 = var(blueLight)// the layout: the centred content column (header contents end flush with it), the side gutter, the header height, the// sidebar and list-pane widths of the shellslayoutColumn = var('72rem')layoutGutter = var('1rem')layoutHeader = var('3.25rem')layoutSidebar = var('16rem')layoutList = var('24rem')// the tap size: every button, icon button, link in a menu or list, tab, crumb and field is at least this tall and wide (44 px, the// minimum touch target); mobile first — only the buttons and menu links of the desktop (min-width 60rem) go denser, on purposelayoutTap = var('2.75rem')// the corner radii — exactly two (docs/design-rules.md "Corner radius"): radiusSmall for every small item (buttons, pills,// fields, tags, menu items, chips, day cells), radiusLarge for everything else that is rounded (panels, modals, popovers,// dropdowns, foldables, tiles/posters); '50%' only for round things (avatars, the check circle). check-theme flags any otherradiusSmall = var('5px')radiusLarge = var('10px')// ---- 2. plain elements -----------------------------------------------------------------------------------------'*,*::before,*::after' { boxSizing = 'border-box' }html { colorScheme = 'dark' scrollbarColor = colorBorder + ' transparent' }body { margin = '0' minHeight = '100dvh' font = '16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif' color = colorText background = colorBackground overflowWrap = 'anywhere' }'::selection' { color = colorAccentText background = colorAccent }'[hidden]' { display = 'none !important' }h1 { margin = '0 0 1rem' fontSize = '1.6rem' lineHeight = '1.25' color = colorTextStrong }h2 { margin = '1.5rem 0 .6rem' fontSize = '1.25rem' lineHeight = '1.3' color = colorTextStrong }h3 { margin = '1.25rem 0 .5rem' fontSize = '1.05rem' lineHeight = '1.3' color = colorTextStrong }h4 { margin = '1rem 0 .4rem' fontSize = '1rem' color = colorTextStrong }p { margin = '0 0 1rem' }strong { color = colorTextStrong }small { fontSize = '.85rem' }'.muted' { color = colorTextMuted }'p.empty' { color = colorTextMuted fontStyle = 'italic' }'.visually-hidden' { position = 'absolute' width = '1px' height = '1px' margin = '-1px' padding = '0' overflow = 'hidden' clip = 'rect(0 0 0 0)' whiteSpace = 'nowrap' border = '0' }ul { margin = '0 0 1rem' paddingLeft = '1.25rem' }ol { margin = '0 0 1rem' paddingLeft = '1.5rem' }li { margin = '.15rem 0' }hr { height = '1px' margin = '1.5rem 0' border = '0' background = colorSurface }img { maxWidth = '100%' height = 'auto' }a { color = colorAccent textDecoration = 'none' textUnderlineOffset = '.2em' }'a:hover' { textDecoration = 'underline' }// a link that IS the item (the first link of a list item, a row of links, a paragraph marked `links`, a crumb) is a tap target; a link// inside a sentence is not (WCAG 2.5.8 exempts it) and keeps its line'li > a:first-child,.links a,.row > a,.crumbs a' { display = 'inline-flex' alignItems = 'center' minHeight = layoutTap }':focus-visible' { outline = '2px solid ' + colorAccent outlineOffset = '2px' }'code,kbd,samp' { padding = '.05rem .3rem' font = '.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace' background = colorSurface borderRadius = radiusSmall }pre { margin = '0 0 1rem' padding = '.75rem 1rem' overflow = 'auto' font = '.9rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace' background = colorBackgroundSunken borderRadius = radiusLarge }'pre code' { padding = '0' background = 'transparent' }// buttons: quiet by default (text on nothing, a surface on hover); `.primary` (and a form's submit) is the accent;// `.danger` says it destroys something — never decoration'button,.button' { display = 'inline-flex' alignItems = 'center' justifyContent = 'center' gap = '.4rem' minWidth = layoutTap minHeight = layoutTap padding = '.4rem .9rem' font = 'inherit' fontWeight = '600' lineHeight = '1.2' color = colorText textDecoration = 'none' background = 'transparent' border = '0' borderRadius = radiusSmall cursor = 'pointer' }'button:hover,.button:hover' { textDecoration = 'none' background = colorSurface }'button.primary,.button.primary,button[type="submit"]' { color = colorAccentText background = colorAccent }'button.primary:hover,.button.primary:hover,button[type="submit"]:hover' { background = colorAccent filter = 'brightness(1.1)' }'button.danger,.button.danger' { color = colorDanger }// the desktop (a pointer, the one breakpoint) may go denser: buttons shrink to 2.25rem, on purpose'@media (min-width: 60rem)' {'button,.button' { minHeight = '2.25rem' }}'button:disabled' { opacity = '.45' cursor = 'default' filter = 'none' }'button svg,.button svg' { flex = 'none' width = '1.25rem' height = '1.25rem' }// fields: a sunken surface, no frame; the focus ring is the accent; an invalid field gets the danger ringlabel { display = 'block' marginBottom = '.25rem' fontWeight = '600' color = colorTextStrong }'input,select,textarea' { maxWidth = '100%' minHeight = layoutTap padding = '.5rem .7rem' font = 'inherit' fontSize = '1rem' color = colorText background = colorBackgroundSunken border = '0' borderRadius = radiusSmall }'input:focus,select:focus,textarea:focus' { outline = '2px solid ' + colorAccent outlineOffset = '0' }'input[aria-invalid="true"],textarea[aria-invalid="true"]' { outline = '2px solid ' + colorDanger outlineOffset = '0' }'input[type="checkbox"],input[type="radio"]' { width = '1.25rem' height = '1.25rem' minHeight = '0' padding = '0' accentColor = colorAccent }// a label around a checkbox / radio is the tap target'label:has(> input[type="checkbox"]),label:has(> input[type="radio"])' { display = 'flex' alignItems = 'center' gap = '.6rem' minHeight = layoutTap }'input::placeholder,textarea::placeholder' { color = colorTextMuted }textarea { width = '100%' minHeight = '6rem' resize = 'vertical' }fieldset { margin = '0 0 1rem' padding = '0' border = '0' }legend { padding = '0' marginBottom = '.5rem' fontWeight = '600' color = colorTextStrong }'form p' { margin = '0 0 1rem' }progress { accentColor = colorAccent }// FOLDABLES: the border belongs to the foldable (the creator likes it on the tracker's season collapsibles)details { margin = '0 0 .75rem' border = '1px solid ' + colorBorder borderRadius = radiusLarge }summary { display = 'block' minHeight = layoutTap padding = '.6rem .9rem' fontWeight = '600' color = colorTextStrong cursor = 'pointer' }'summary:hover' { background = colorSurface }'details[open] > summary' { borderBottom = '1px solid ' + colorBorder }'details > :not(summary)' { marginLeft = '.9rem' marginRight = '.9rem' }'details > summary + *' { marginTop = '.75rem' }'details > :last-child:not(summary)' { marginBottom = '.75rem' }// DROP ZONES: a dashed border says "drop here"; `.over` while something is dragged over it'drop-zone,.drop-zone' { display = 'block' padding = '1.25rem' textAlign = 'center' color = colorTextMuted border = '2px dashed ' + colorBorder borderRadius = radiusLarge }'drop-zone.over,.drop-zone.over' { color = colorText borderColor = colorAccent background = colorSurface }// tables: no grid; the header row is muted, a row lights up under the pointertable { width = '100%' margin = '0 0 1rem' borderCollapse = 'collapse' }th { padding = '.4rem .6rem' fontSize = '.85rem' fontWeight = '600' textAlign = 'left' color = colorTextMuted }td { padding = '.5rem .6rem' verticalAlign = 'top' }'tbody tr:nth-child(odd)' { background = colorBackgroundSunken }'tbody tr:hover' { background = colorSurface }// type colours and pills: `class="type-2"` colours a text with its slot; `.pill` turns it into an inverted label (text on// the colour); a pill without a type is the accent. Status words use the semantic roles: `.success`, `.warning`, `.danger`'.type-1' { color = colorType1 }'.type-2' { color = colorType2 }'.type-3' { color = colorType3 }'.type-4' { color = colorType4 }'.type-5' { color = colorType5 }'.type-6' { color = colorType6 }'.success' { color = colorSuccess }'.warning' { color = colorWarning }'.danger' { color = colorDanger }'.pill' { display = 'inline-block' padding = '.1rem .55rem' fontSize = '.8rem' fontWeight = '700' lineHeight = '1.5' color = colorAccentText background = colorAccent borderRadius = radiusSmall whiteSpace = 'nowrap' }'.pill.type-1' { color = colorAccentText background = colorType1 }'.pill.type-2' { color = colorAccentText background = colorType2 }'.pill.type-3' { color = colorAccentText background = colorType3 }'.pill.type-4' { color = colorAccentText background = colorType4 }'.pill.type-5' { color = colorAccentText background = colorType5 }'.pill.type-6' { color = colorAccentText background = colorType6 }'.pill.success' { color = colorAccentText background = colorSuccess }'.pill.warning' { color = colorAccentText background = colorWarning }'.pill.danger' { color = colorAccentText background = colorDanger }'.pill.quiet' { color = colorText background = colorSurface }// ---- 3. the components of components.hybriel.worldapi.org --------------------------------------------------------// Their own Style draws frames around buttons, fields, editors and day cells. The theme takes the decorative ones away// (the drop zone's dashed border and the focus rings stay — they mean something) and lets surfaces separate instead.// Their corners become the theme's two radii: small items radiusSmall, popups / windows / editors / day tiles radiusLarge.// pagination'html pagination button' { border = '0' borderRadius = radiusSmall minWidth = layoutTap }'html pagination li.current button' { border = '0' }// modal: the dimmed page around the window is the separation'html modal-dialog > dialog' { background = colorSurface border = '0' borderRadius = radiusLarge boxShadow = '0 1rem 3rem ' + colorBackgroundSunken }'html modal-dialog header' { borderBottom = '0' }'html modal-dialog modal-body footer' { background = colorSurface borderTop = '0' }'html modal-dialog button' { borderRadius = radiusSmall }'html modal-dialog button:hover' { background = colorBackground }// month view: the day cells are tiles with a gap, no grid lines'html month-view ol' { gap = '.25rem' }'html month-view button' { border = '0' borderRadius = radiusSmall }'html #month-days li' { border = '0' borderRadius = radiusLarge }// date picker + date range picker: borderless field, the popup is a raised surface'html date-picker input' { border = '0' borderRadius = radiusSmall }'html range-picker input' { border = '0' borderRadius = radiusSmall }'html date-picker input[aria-invalid="true"]' { outline = '2px solid ' + colorDanger outlineOffset = '-2px' }'html range-picker input[aria-invalid="true"]' { outline = '2px solid ' + colorDanger outlineOffset = '-2px' }'html date-picker month-view' { background = colorSurface border = '0' borderRadius = radiusLarge boxShadow = '0 .75rem 2rem ' + colorBackgroundSunken }'html range-picker month-view' { background = colorSurface border = '0' borderRadius = radiusLarge boxShadow = '0 .75rem 2rem ' + colorBackgroundSunken }'html date-picker button' { border = '0' borderRadius = radiusSmall }'html range-picker button' { border = '0' borderRadius = radiusSmall }'html date-picker month-view ol' { gap = '.2rem' }'html range-picker month-view ol' { gap = '.2rem' }'html date-picker ol.days li' { background = colorBackground border = '0' borderRadius = radiusSmall }'html range-picker ol.days li' { background = colorBackground border = '0' borderRadius = radiusSmall }'html date-picker ol.days li.outside' { background = 'transparent' }'html range-picker ol.days li.outside' { background = 'transparent' }'html date-picker ol.days li.selected' { background = colorAccent }'html range-picker ol.days li.selected' { background = colorAccent }'html range-picker ol.days li.between' { background = colorBackgroundSunken outline = '0' }'html range-picker ol.days li.between time' { color = colorAccent }// file upload: the drop zone keeps its dashed border (it is a drop zone); the choose button is a plain button'html file-upload drop-zone' { borderRadius = radiusLarge }'html file-upload label.choose' { display = 'inline-flex' alignItems = 'center' minHeight = layoutTap fontWeight = '600' border = '0' borderRadius = radiusSmall }'html file-upload label.choose:hover' { color = colorTextStrong filter = 'brightness(1.15)' }// file upload, several files: the same (the component's own radii are .5rem and .35rem)'html files-upload drop-zone' { borderRadius = radiusLarge }'html files-upload pick-area' { borderRadius = radiusLarge }'html files-upload ul.files img.thumb, html files-upload ul.files .kind, html files-upload button.remove' { borderRadius = radiusSmall }'html files-upload label.camera' { borderRadius = radiusSmall }'html files-upload label.choose' { display = 'inline-flex' alignItems = 'center' minHeight = layoutTap fontWeight = '600' border = '0' borderRadius = radiusSmall }'html files-upload label.choose:hover' { color = colorTextStrong filter = 'brightness(1.15)' }// Markdown editor: one sunken surface, the toolbar a surface strip; no lines between the parts'html md-editor' { border = '0' borderRadius = radiusLarge }'html md-editor nav' { borderBottom = '0' borderRadius = radiusLarge + ' ' + radiusLarge + ' 0 0' }'html md-editor nav button' { minWidth = layoutTap minHeight = layoutTap borderRadius = radiusSmall }'html md-editor ul.files' { borderBottom = '0' }'html md-editor link-form' { borderBottom = '0' background = colorSurface }'html md-editor link-form input' { border = '0' borderRadius = radiusSmall }'html md-editor link-form button' { border = '0' borderRadius = radiusSmall }'html md-editor article img' { borderRadius = radiusLarge }'html md-editor article code' { borderRadius = radiusSmall }'html md-editor article pre' { border = '0' borderRadius = radiusLarge }'html md-editor td a,html md-editor th a' { display = 'inline-flex' alignItems = 'center' minHeight = layoutTap } // a link alone in a table cell is a tap target'html md-editor footer' { borderTop = '0' }'html md-editor footer button' { border = '0' borderRadius = radiusSmall }// code editor: the gutter is a surface beside the sunken text, no line between them'html code-editor' { border = '0' borderRadius = radiusLarge }'html code-editor code-gutter' { borderRight = '0' }
Branches
Latest commits
- 1bbbf0edtests/browser.mjs: wait for hydration before clicking the login button on / (device B)mre
- 6f503cfctests/cdp.mjs: HL_CPU_THROTTLE=<rate> optional CPU throttling for gate runsmre
- e17e2855re-vendor Hybriel 5406d146 (hl:web batches 9+10: #72 emits while the socket is closed delivered after reconnect, browser boot linear, faster list appends; contains int 6–14 + m406)mre
- a6ddccd2re-vendor Hybriel 6f8a0689 (int 6–11: streaming cursors, #203 index heal + close() fix, fd403 listDir/cursor fds, hl:time browser side, hl:web batches 5+6)mre
- 81e036b7docker-compose: nofile 65536 (Hybriel int 6+ boot opened >1024 files in the tracker)mre
- 5d8d2cf6deploy: backup copies index files first and *.mpack data last (hot-copy skew, hybriel #203)mre
- 58e8c02cmission 024: report, LOG, STATUS, e2e fixmre
- 50778073tests/e2e-route-marker.mjs: first paint marker, comments post/edit redrawmre
- c5203298mission 024: MainMenu marks the page from the route (layouts 0bcc629 main-menu.hl); browser-side marker removed; gate: marker in the server HTMLmre
- b1a4c270re-vendor Hybriel master f9614007: bin/ (git-ignored) and plugins wholemre
- 866397a0mission 023: theme from layouts 76f99f6 (current marker, menu count badge), components from 3794c59 (MdEditor keys); Inbox count as badge, current by address; gates and E2E; reportmre
- 7ed2e5e5deploy.sh: a gate without a 'passed,' line (check-theme) no longer ends the script silently (grep under pipefail), as gitoria/layoutsmre
- bf9064a3mission 022: tickets on the layouts theme (step 1): shell, styles, gates, audit, E2E; reportmre
- f3d61711mission 022 WIP: tickets on the layouts theme (dbe3de7): AppHeader/MainMenu/UserMenu/Sidebar/ContentFirst shell, styles reduced to the app's own, check-theme in the gates, 390 audit + real-Chrome walk scriptmre
- 31cabfccmission 021: E2E script, report, LOG, STATUSmre
- 6aea8683editor look: .empty rule only for p.empty, files off where tickets has no upload, state note one line, events test scrolls the editor into view; synced md-editor (components d702d76+6f27ad3); gate 377/0, events 52/0mre
- dce6ffa6Merge branch 'w28-deflake'mre
- 536092a1tickets (mission 019): de-flake the m016 comment clicks (B: unliked) — calmClick waits until the button stops moving; test only, no app changemre
- 9c5fd42amission 020: attachments E2E proof (lisbeth Chrome, real-data copy), reportmre
- 1206404fREADME attachments, report 018, LOG/STATUSmre