ThemingPDF
Every --lq-pdf-* custom property of the PDF viewer with its default in the light and dark themes, and how the tokens fall back to the shared --lq-* tokens.
The viewer reads its colours and sizes from custom properties. Each --lq-pdf-* token falls back to a shared --lq-* token where one exists, so a theme set for the other Birch UI components applies here too. Override a token on .lq-pdf or on any ancestor.
#review .lq-pdf {
--lq-pdf-accent: #0b5cad;
--lq-pdf-canvas-bg: #eef1f4;
--lq-pdf-sidebar-width: 260px;
}| Token | Falls back to | Light | Dark | Used for |
|---|---|---|---|---|
--lq-pdf-font-family |
--lq-font-family |
system UI stack | system UI stack | All interface text |
--lq-pdf-font-size |
--lq-font-size |
13px |
13px |
Base text size |
--lq-pdf-fg |
--lq-fg |
#1f2328 |
#e6edf3 |
Text |
--lq-pdf-bg |
--lq-bg |
#ffffff |
#0d1117 |
Viewer and panel background |
--lq-pdf-muted |
--lq-muted-fg |
#59636e |
#9198a1 |
Secondary text |
--lq-pdf-border |
--lq-border |
#d1d9e0 |
#3d444d |
Borders and separators |
--lq-pdf-chrome-bg |
--lq-header-bg |
#f6f8fa |
#151b23 |
Toolbar, tab strip and sidebar tabs |
--lq-pdf-accent |
--lq-accent |
#1f6feb |
#4493f8 |
Active tools, primary buttons, selection handles |
--lq-pdf-accent-fg |
--lq-accent-fg |
#ffffff |
#0d1117 |
Text on the accent colour |
--lq-pdf-focus |
--lq-focus-ring |
#1f6feb |
#4493f8 |
Focus ring |
--lq-pdf-selection-bg |
--lq-selection-bg |
rgba(31, 111, 235, 0.12) |
rgba(68, 147, 248, 0.2) |
Selected items, hover, status lines |
--lq-pdf-radius |
--lq-radius |
6px |
6px |
Corner radius of menus, popovers and panes |
--lq-pdf-radius-surface |
--lq-radius-surface, then --lq-pdf-radius |
6px |
6px |
The same radius under the name of the shared system |
--lq-pdf-radius-control |
--lq-radius-control |
4px |
4px |
Corner radius of buttons, fields, menu items and toggles |
--lq-pdf-radius-dialog |
--lq-radius-dialog |
8px |
8px |
Corner radius of dialogs |
--lq-pdf-control-height |
--lq-control-height |
32px |
32px |
Height of buttons, fields, selects and menu items |
--lq-pdf-surface-2 |
--lq-surface-2, then --lq-pdf-chrome-bg |
#f6f8fa |
#151b23 |
Second neutral: toolbar, tool row and sidebar |
--lq-pdf-border-subtle |
--lq-border-subtle |
#e6eaef |
#262c36 |
Quiet dividers, such as the line above dialog buttons |
--lq-pdf-input-border |
--lq-input-border |
#818b98 |
#6e7681 |
Edge of fields and outlined buttons, at least 3:1 on both neutrals |
--lq-pdf-hover |
--lq-row-hover |
#eef2f6 |
#1f2630 |
Hover fill |
--lq-pdf-active-bg |
text colour at 12% | same rule | Fill while the pointer is down | |
--lq-pdf-pressed-bg |
accent at 16% | same rule | Fill of a pressed toggle, a checked menu item and the selected tab | |
--lq-pdf-pressed-edge |
accent at 55% | same rule | Edge of a pressed toggle | |
--lq-pdf-text-xs |
--lq-text-xs |
11px |
11px |
Group captions and shortcuts in menus |
--lq-pdf-text-sm |
--lq-text-sm |
12px |
12px |
Menu headings and pane titles |
--lq-pdf-text-lg |
--lq-text-lg |
15px |
15px |
Dialog titles |
--lq-pdf-panel-bg |
--lq-menu-bg |
#ffffff |
#161b22 |
Menus, popovers, dialogs |
--lq-pdf-panel-shadow |
--lq-menu-shadow |
0 8px 24px rgba(15, 23, 42, 0.16) |
0 8px 24px rgba(0, 0, 0, 0.5) |
Shadow of menus and dialogs |
--lq-pdf-canvas-bg |
#e6e9ed |
#010409 |
Area behind the pages | |
--lq-pdf-page-shadow |
0 1px 3px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08) |
0 1px 3px rgba(0, 0, 0, 0.6) |
Shadow of a page | |
--lq-pdf-search-hit |
rgba(255, 196, 0, 0.42) |
same | Search matches | |
--lq-pdf-search-current |
rgba(255, 120, 0, 0.55) |
same | The current search match | |
--lq-pdf-read-highlight |
rgba(64, 196, 255, 0.35) |
same | The line being read aloud | |
--lq-pdf-danger |
#cf222e |
#f85149 |
Errors and destructive buttons | |
--lq-pdf-sidebar-width |
220px |
220px |
Width of the sidebar | |
--lq-pdf-presence-color |
#0969da |
same | Collaborator cursors; set per collaborator by the viewer | |
--lq-pdf-comb-cell |
1ch |
1ch |
Cell width of comb fields; set per field by the viewer | |
--lq-pdf-print-ratio |
width divided by height of the page | same | Shape of a printed page when the print scale is Fit to paper; set per page by the viewer |
theme: 'dark' and theme: 'auto' with a dark system setting switch the shared tokens; the "Dark" column shows the result.
States#
Every control uses the same eight states, built from the tokens above:
| State | Treatment |
|---|---|
| Rest | Transparent on a toolbar, outlined in --lq-pdf-input-border elsewhere |
| Hover | --lq-pdf-hover |
| Active (pointer down) | --lq-pdf-active-bg |
| Focus | 2 px outline in --lq-pdf-focus, offset 1 px, on :focus-visible |
| Selected or pressed | --lq-pdf-pressed-bg with an edge in --lq-pdf-pressed-edge (aria-pressed, aria-checked, aria-selected) |
| Disabled | 55% opacity and a not-allowed cursor, with disabled or aria-disabled |
| Loading | aria-busy="true": 70% opacity and a progress cursor |
| Error | aria-invalid="true": an edge and an inset outline in --lq-pdf-danger |
The accent fills only the one primary button of a dialog. Destructive buttons are outlined in the danger colour. Nothing in the viewer chrome is animated, and prefers-reduced-motion: reduce switches off any transition a host stylesheet adds. Under forced-colors: active the focus ring is Highlight, fields and buttons take ButtonText edges, the primary button and pressed toggles are Highlight on HighlightText, and disabled controls use GrayText.
Document tokens#
Colours that belong to the document rather than to the interface have tokens of their own. They keep the same value in the dark theme, because they are drawn on white paper; override them when your pages or your brand need something else.
| Token | Shared token | Light | Dark | Used for |
|---|---|---|---|---|
--lq-pdf-page-bg |
#ffffff |
same | Paper: pages, thumbnails, form fields in focus, the signature pad | |
--lq-pdf-page-fg |
#1f2328 |
same | Text typed on the page: form fields and content editing | |
--lq-pdf-text-selection |
rgba(0, 92, 230, 0.28) |
same | Selected page text | |
--lq-pdf-snap-guide |
#d1242f |
same | Snap marker | |
--lq-pdf-page-accent |
#1f6feb |
same | Field outlines in the form designer, radio buttons, "moved" in the compare list | |
--lq-pdf-page-accent-fg |
#0b2a6f |
same | Labels of design boxes and signature fields, typed signatures | |
--lq-pdf-page-accent-soft |
rgba(31, 111, 235, 0.12) |
same | Link hover and design boxes | |
--lq-pdf-page-accent-strong |
rgba(31, 111, 235, 0.22) |
same | Selected design boxes | |
--lq-pdf-field-border |
#818b98 |
same | Border of a form field and comb cell lines; dotted on a read-only field | |
--lq-pdf-field-bg |
rgba(221, 235, 255, 0.55) |
same | Tint of a form field | |
--lq-pdf-field-button-bg |
rgba(221, 235, 255, 0.85) |
same | Tint of a push button | |
--lq-pdf-field-required-bg |
rgba(255, 235, 233, 0.6) |
same | Tint of a required field when required fields are highlighted | |
--lq-pdf-page-danger |
#cf222e |
same | Invalid and required fields, broken signatures, "deleted" in the compare list | |
--lq-pdf-page-danger-soft |
rgba(255, 235, 233, 0.8) |
same | Tint of a broken signature field | |
--lq-pdf-page-danger-bg |
#fff5f5 |
same | Background of a field error message | |
--lq-pdf-page-danger-fg |
#8a1320 |
same | Text of a field error message | |
--lq-pdf-page-success |
#1a7f37 |
same | Signed fields, valid signatures, "inserted" in the compare list | |
--lq-pdf-page-success-soft |
rgba(218, 251, 225, 0.7) |
same | Tint of a signed field | |
--lq-pdf-page-warning |
#bf8700 |
same | Signature warnings and the current difference in the compare view | |
--lq-pdf-page-hint |
#9a6700 |
same | Border of a field hint | |
--lq-pdf-page-hint-bg |
#fff8c5 |
same | Background of a field hint | |
--lq-pdf-page-hint-fg |
#5c3d00 |
same | Text of a field hint | |
--lq-pdf-page-loading-sheen |
#f1f3f5 |
same | Shimmer of a page that is still loading | |
--lq-pdf-barcode-stripe |
rgba(31, 35, 40, 0.18) |
same | Stripes of a barcode field placeholder | |
--lq-pdf-compare-inserted |
rgba(46, 160, 67, 0.4) |
same | Inserted text in the compare view | |
--lq-pdf-compare-deleted |
rgba(248, 81, 73, 0.4) |
same | Deleted text in the compare view | |
--lq-pdf-compare-moved |
rgba(56, 139, 253, 0.36) |
same | Moved text in the compare view | |
--lq-pdf-compare-diff-opacity |
0.7 |
same | Opacity of the highlight layer of the visual comparison; the slider in the compare view sets it on the panes | |
--lq-pdf-compare-missing |
rgba(127, 127, 127, 0.16) |
same | Hatching of a page that exists on one side only | |
--lq-pdf-toast-bg |
#1f2328 |
same | Background of a notification | |
--lq-pdf-toast-fg |
#ffffff |
same | Text of a notification | |
--lq-pdf-toast-error-bg |
#8f1a22 |
same | Background of an error notification | |
--lq-pdf-editor-bg |
rgba(255, 255, 255, 0.95) |
same | Background of the text box editor | |
--lq-pdf-backdrop |
rgba(15, 23, 42, 0.45) |
same | Scrim behind dialogs | |
--lq-pdf-presentation-bg |
#000000 |
same | Background in presentation mode | |
--lq-pdf-presence-default |
#0969da |
same | Collaborator colour when none is set | |
--lq-pdf-presence-fg |
#ffffff |
same | Text on a collaborator label |
Annotation colours are data in the document, not style rules. The one fixed colour left in the stylesheet is the white body background while printing, which is outside the viewer element.