Skip to content

Theming ​

The editor ships a light and a dark theme for its chrome (ribbon, formula bar, headers, tabs, dialogs). The theme attribute or property selects one: light, dark, or auto (the default) to follow the operating system's prefers-color-scheme. Cell content is always drawn with the workbook's own colours on a white sheet, like Excel.

html
<xlsx-editor theme="dark"></xlsx-editor>

Token overrides ​

themeColors overrides individual tokens. Each key becomes a --xve-<kebab-key> custom property on the host element, with the same token set the Word editor uses (--dve-* there), so one design system can drive both:

KeyUsed for
background, foregroundEditor canvas and text
card, cardForegroundRibbon and panels
popover, popoverForegroundMenus and dropdowns
primary, primaryForegroundAccent (title bar, selection, active tab)
secondary, secondaryForegroundSecondary buttons
muted, mutedForegroundHeaders, hints, disabled text
accent, accentForegroundHover and pressed states
destructive, destructiveForegroundErrors
border, input, ringLines, fields and focus rings
radiusCorner radius
ts
editor.themeColors = { primary: '#1f9d63', ring: '#1f9d63', radius: '6px' };

You can also set the custom properties in CSS:

css
xlsx-editor {
	--xve-primary: #1f9d63;
}

Following a site theme ​

The demo follows the VitePress vitepress-theme-appearance key in localStorage and sets theme on every editor when it changes (see demos/demo-vanilla/theme.ts). Do the same with your own site setting; the editor never reads localStorage itself.

Released under the Apache-2.0 License.