gitoria

notes

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit6140e6a06140e6a0sessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre6140e6a0/components/styles.hl

6.4 KB

  1. // components/styles.hl — the app's own CSS, served as /__hl/app.css. It INHERITS THE WORLDAPI THEME (theme/theme.hl, copied
  2. // verbatim from layouts.worldapi.org dbe3de7 — never edited here) and adds only what the notes need: the ident login in the
  3. // header, the note list and the editor's frame. Components carry no Style blocks: markup is domain tags (<note-list>,
  4. // <note-reader>, <note-editor>, …), this file lays them out. The layout is the theme's list-first shell (theme/shell/list-first.hl:
  5. // the list on the phone, a tap opens the note alone; side by side from 60rem), the header the theme's AppHeader.
  6. // Tokens: shared/tokens.hl (layouts' file, byte-equal); the app sets only its accent (yellow). Borderless:
  7. // `node theme/check-theme.mjs .` must report 0 problems (a deploy gate).
  8. // In a styles file a bare name is a TAG (camelCase → kebab), a quoted name is a selector written verbatim; a selector the theme
  9. // already writes may not be written again (hl:web refuses it) — the theme's own elements (links, headings, fields, buttons,
  10. // `.muted`, `p.empty`, the 44 px taps) are NOT repeated here.
  11. // MOBILE FIRST: every rule outside a block is the phone's; the one `@media (min-width: 60rem)` block only ADDS the wide layout.
  12. inherit '../theme/theme.hl'
  13. import { var } from 'hl:web/css'
  14. import { yellow, colorText, colorTextStrong, colorTextMuted, colorBackgroundSunken, colorAccentText, colorSurface, colorDanger } from '../shared/tokens.hl'
  15. colorAccent = var(yellow) // the app's accent: the only token this app sets
  16. '.message' { color = colorDanger }
  17. '.message:empty' { display = 'none' }
  18. '#loginerror' { margin = '0' padding = '.5rem var(--layout-gutter)' background = colorBackgroundSunken }
  19. // ---- the login in the header (components/main.hl) -------------------------------------------------------------------------
  20. // SIGNED OUT: the ident icon at the far right (phone) opens the dropdown with ident's selector and the login button; from 60rem
  21. // they stand in the header. Signed in (class `in`) it is not shown: the user menu stands there (the selector stays in the page,
  22. // /login.js keeps its state).
  23. identMenu { display = 'block' flex = 'none' }
  24. 'ident-menu.in' { display = 'none' }
  25. 'ident-menu > button.ident-toggle' { width = layoutTap height = layoutTap marginRight = '-.5rem' padding = '0' color = colorText }
  26. 'ident-menu svg.ident-icon' { width = '2rem' height = '1.32rem' }
  27. 'svg.ident-icon .ident-d' { fill = colorTextStrong }
  28. 'svg.ident-icon .ident-d-side' { fill = colorTextMuted }
  29. 'svg.ident-icon .ident-i' { fill = colorAccent }
  30. '#ident-panel:popover-open' { position = 'fixed' inset = 'var(--layout-header) var(--layout-gutter) auto auto' display = 'grid' gap = '.6rem' width = 'auto' minWidth = '14rem' maxWidth = 'calc(100vw - 2 * var(--layout-gutter))' height = 'auto' margin = '.25rem 0 0' padding = '.75rem' color = colorText background = colorSurface border = '0' borderRadius = radiusLarge boxShadow = '0 .75rem 2rem ' + colorBackgroundSunken }
  31. '#ident-panel::backdrop' { background = 'transparent' }
  32. // ident's selector (its shadow DOM in ident's design, restyled to the accent through its custom properties and parts)
  33. identSelector { '--ident-accent' = colorAccent '--ident-accent-text' = colorAccentText '--ident-background' = colorSurface '--ident-border' = colorSurface '--ident-font' = '600 1rem/1.4 system-ui, sans-serif' minWidth = '0' }
  34. 'ident-selector::part(button)' { minHeight = layoutTap padding = '.35rem .8rem' whiteSpace = 'nowrap' }
  35. 'ident-selector::part(status)' { minHeight = layoutTap padding = '.35rem .8rem' }
  36. 'ident-selector::part(identity)' { minHeight = layoutTap }
  37. // ---- the notes: the list (list-first's aside) and the opened note (its main) ------------------------------------------------
  38. noteList { display = 'grid' gap = '.6rem' alignContent = 'start' }
  39. // the aside has only 4 px of side padding (the rows carry their own 12 px, so their text stands on the 16 px gutter): the header
  40. // takes the same 12 px, so "Notes" and "New note" stand on the gutter too instead of touching the screen edge
  41. 'note-list > header' { display = 'flex' alignItems = 'center' justifyContent = 'space-between' gap = '1rem' padding = '0 .75rem' }
  42. 'note-list h1' { margin = '0' }
  43. 'note-list p' { margin = '0' }
  44. '#notes' { margin = '0' padding = '0' listStyle = 'none' }
  45. noteReader { display = 'block' minWidth = '0' }
  46. noteEditor { display = 'grid' gridTemplateColumns = 'minmax(0, 1fr)' gap = '.8rem' }
  47. // the editor's wrapper: a block that may shrink (a wide table scrolls inside the editor, it does not widen the page)
  48. noteText { display = 'block' minWidth = '0' }
  49. 'note-editor footer' { display = 'flex' flexWrap = 'wrap' alignItems = 'center' gap = '.6rem' padding = '.3rem 0' }
  50. 'list-first note-editor a.back' { marginBottom = '0' }
  51. '.ask' { display = 'none' alignItems = 'center' gap = '.6rem' margin = '0' }
  52. // the delete confirmation: the question on its own line, then Delete and Keep as two equal buttons (a phone shows them side by side
  53. // on the full width; they used to wrap into a ragged line with "Keep" alone below)
  54. '.ask.open' { display = 'flex' flexWrap = 'wrap' flex = '1 0 100%' padding = '0' }
  55. askText { display = 'block' flex = '1 0 100%' }
  56. '.ask button' { flex = '1 1 0' maxWidth = '12rem' background = colorSurface }
  57. // the footer has no side padding: the "Delete note" button's left edge and the Delete/Keep row's two edges are the editor's edges
  58. // the page's clock (components/notes.hl): an invisible endless 1 s animation, each round is a tick
  59. notesTick { position = 'fixed' left = '0' top = '0' width = '1px' height = '1px' opacity = '0' pointerEvents = 'none' animation = 'notes-tick 1s linear infinite' }
  60. '@keyframes notes-tick' = {
  61. 'from' = { opacity = '0' }
  62. to = { opacity = '0' }
  63. }
  64. '@media (min-width: 60rem)' = {
  65. // signed out, from 60rem the selector and the login button stand in the header themselves (no icon, no dropdown)
  66. 'ident-menu > button.ident-toggle' = { display = 'none' }
  67. '#ident-panel,
  68. #ident-panel:popover-open' = { position = 'static' inset = 'auto' display = 'flex' alignItems = 'center' gap = '.5rem' width = 'auto' minWidth = '0' maxWidth = 'none' height = 'auto' margin = '0' padding = '0' overflow = 'visible' color = 'inherit' background = 'transparent' border = '0' boxShadow = 'none' }
  69. identSelector = { position = 'relative' }
  70. 'ident-selector::part(panel)' = { position = 'absolute' top = '100%' right = '0' zIndex = '30' boxShadow = '0 .75rem 2rem ' + colorBackgroundSunken }
  71. }

Branches

Latest commits

  • 6140e6a0sessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
  • cb7e6469deploy: security gate (tests/security.mjs)mre
  • 774bf34bnotes security: CSRF guard on /api/notes, new session at login, Secure cookie, uploadMax 0, login rate limit, nosniff, face payload check; tests/security.mjs; SN reportmre
  • ef18a68fsync components.hybriel 214c318: MdEditor on a phone, two even toolbar rows of 44 px targets, label 15 px, table head 16 px (E2)mre
  • c37488b1MN report: alignment updatemre
  • 4fb35a0enotes mobile: Delete note and the delete row exactly on the editor's edges; gate asserts 1 pxmre
  • 91736270MN report and logmre
  • 15667425notes: delete confirmation buttons at most 12rem wide on the desktopmre
  • 8f7a6a95gate: MN phone checks (list header gutter, back gap, delete question)mre
  • 90c73ed3notes mobile: back link gapmre
  • 72bd4f83notes mobile: list header on the gutter, delete confirmation as a question + two equal buttons, Delete note under the editor edgemre
  • ba1e73f8notes: a sent edit is done once the server's version is not older, so a second writer's text shows in the first tab; gate: two writers both waysmre
  • c69ef9ebsync components.hybriel 134b4e3: MdEditor builds an editor put into the page at once, redraws a surface put in anew (F5, hybriel#211)mre
  • 2eb783f5sync components 9a: shared Icon (icons/icons.hl), md-editor toolbar icons + single focus ring (components f4-icons ba96735)mre
  • 4dd46dadsync-components: copy icons/icons.hl + README (F4); testsmre
  • c92e4a0ftests/e2e-outside.mjs: real-Chrome E2E, a note pushed from another device while open, then typingmre
  • 0516b4ccmd-editor.hl: verbatim copy of components f3-mdvalue (an older text handed back is kept)mre
  • 38cc11ecmd-editor.hl: verbatim copy of components f3-mdvalue (an outside value change is shown by the editor)mre
  • 3e7e79f5reports/H1-hydrate.mdmre
  • d98775e8tests/browser.mjs: wait for hydration before the clicks after a goto('/') (tables new note, phone sidebar)mre