Skip to content

Theming ​

The default theme is a quiet, neutral-gray chrome with a single swappable accent. The accent defaults to near-black "ink" in light mode and inverts to near-white "paper" in dark mode. The focus ring is a dedicated token (never the accent) so it stays legible on any re-skin.

Theme modes ​

Set the mode with the theme prop – light, dark, or auto. auto follows prefers-color-scheme and reacts to system changes live; the accent inverts automatically between light and dark.

vue
<PdfViewer theme="auto" />

Tokens ​

Override any --vue-pdfz-* custom property:

css
/* Re-skin to a blue accent – coexists with light/dark mode */
.vue-pdfz-viewer {
  --vue-pdfz-color-primary: #2f6bff;
  --vue-pdfz-color-primary-hover: #1f54da;
  --vue-pdfz-color-primary-contrast: #fff;
}

Or inline through the themeTokens prop (a partial token object):

vue
<PdfViewer
  :theme-tokens="{
    colorPrimary: '#2f6bff',
    colorPrimaryHover: '#1f54da',
    colorPrimaryContrast: '#fff',
  }"
/>

Token reference ​

GroupTokens
SurfacescolorBg, colorSurface, colorSurfaceActive, colorHover, colorSidebarBg, colorToolbarBg, colorPage, colorBackdrop
BorderscolorBorder, colorBorderStrong
TextcolorText, colorTextSecondary, colorTextMuted, colorToolbarText
AccentcolorPrimary, colorPrimaryHover, colorPrimaryContrast
HighlightcolorHighlight, colorHighlightActive, colorFocusRing, colorDanger
MetricstoolbarHeight, sidebarWidth, controlSize, iconSize, radius, spacing, pageGap
TypefontFamily, fontSize
Shadowsshadow, shadowElevated, shadowPopover, shadowPage
Motiontransition, duration, durationSlow, ease

These are the keys of the ThemeTokens interface (the themeTokens prop's type), exported from vue-pdfz.