Repository navigation
Conversation
…ects
Every color in the stylesheet is now a --de-* token on .de-root, with the
dark values on .de-root.de-dark: find highlights, collaboration status,
avatars, slideshow, tooltips, file badges, paper and placeholders, and the
source editor's syntax colors (moved to the root so a theme reaches them).
Fonts, radii and shadows are tokens too. Rendering is unchanged: a
computed-style comparison against the previous stylesheet over DOCX, XLSX,
PPTX and Markdown, light and dark, differs only in equivalent font stacks
and the color-button swatch edge, which now follows swatch-border (visible
in dark).
- theme accepts { mode, tokens, light, dark } with typed camelCase token
names (ThemeTokens); THEME_TOKENS, createTheme, themeStyle, useThemeRoot
- injectStyles={false} and @p10node/office-engine/styles.css for hosts that
load the stylesheet themselves (CSP, extracted CSS, cascade layers)
- docs/theming.md; unit tests keep THEME_TOKENS and the stylesheet in step
and reject literal colors outside token definitions; e2e for theme
objects in both modes and for injectStyles=false
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 14, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This lets a host give the viewer its own look without overriding the stylesheet's selectors.
Every color in
styles.cssis now a--de-*custom property on.de-root, with the dark values on.de-root.de-dark. That includes the find highlights, collaboration status and avatars, the slideshow, tooltips, file badges, paper and placeholders, and the source editor's syntax colors, which moved to the root so a theme reaches them. Fonts, radii and shadows are tokens too.themestill takes'light' | 'dark' | 'auto', and now also an object:Token names are typed and camelCase (
accentHoversets--de-accent-hover, list inTHEME_TOKENS).createTheme,themeStyleanduseThemeRootare exported for hosts that mountDocxView,XlsxVieworPptxViewin a root of their own. A host that cannot inject a style tag (CSP, extracted CSS, cascade layers) passesinjectStyles={false}and imports@p10node/office-engine/styles.css.docs/theming.mddescribes it all.Rendering is unchanged. I compared computed styles against the current stylesheet over DOCX, XLSX, PPTX and Markdown files, light and dark. The only differences are equivalent font stacks and the color button's swatch edge, which now follows
swatch-borderand so is visible in dark mode.test/theme.test.tskeepsTHEME_TOKENSand the stylesheet in step and fails on a literal color outside a token definition.e2e/viewer.spec.tscovers theme objects in both modes andinjectStyles={false}. On currentmain(v0.13.2),bun run typecheck,bun testand the e2e suite pass in CI.This is the first of a few small PRs I'd like to propose, each building on the one before: host icons, translatable UI texts (English and German), replaceable toolbar components, and a headless mode where the host draws its own controls from a controller. Happy to rename things or split this further if you prefer.
🤖 Generated with Claude Code