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>
Every icon the chrome draws now goes through `Icon`: the zoom buttons,
the outline toggle and its close button, find & replace, Present and the
add-sheet tab used text glyphs and get the names `zoomIn`, `zoomOut`,
`present`, `sheetAdd`, `replace` (with `outline` and `close` reused),
drawn like today.
- `IconName` is the union of the built-in names (exported with
`ICON_NAMES`); icon props in the toolbars, menus and `FileMenuItem`
are typed with it.
- `icons` on DocViewer, `mount()` and `<office-viewer>` (`.icons`
property) takes a partial map or a resolver `(name, { size })`;
a missing entry or `undefined` / `null` keeps the built-in icon.
Host icons render in `span.de-icon`, sized by font-size.
- `IconsProvider` gives standalone views the same icons; nested
providers fall back to the enclosing one.
- Docs with Lucide and Phosphor resolvers; unit test for precedence,
e2e spec for DOCX, XLSX and PPTX chrome.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Builds on #4 (theming). Until that is merged this PR shows its commit too; the icons part is the last three commits.
This lets a host draw the viewer's chrome with its own icon set, all of it or just a few icons.
Every icon the chrome draws now goes through
Icon. A few controls still used text glyphs: the zoom buttons, the outline toggle and its close button, find & replace, Present and the add-sheet tab. They get the nameszoomIn,zoomOut,present,sheetAddandreplace(outlineandcloseare reused) and look the same as before.iconsonDocViewer,mount()and<office-viewer>(as the.iconsproperty) takes a partial map or a resolver:A name the map leaves out, or a resolver returning
undefinedornull, keeps the built-in icon. Host icons render inspan.de-icon, sized by its font-size, so an icon drawn at1emwithcurrentColorfollows the size and the theme.IconNameis the union of the built-in names (all of them inICON_NAMES), and the icon props in the toolbars, menus andFileMenuItemare typed with it.IconsProvidergives the standalone views the same icons; a nested provider falls back to the enclosing one.docs/api.mdhas Lucide and Phosphor examples; there are no new dependencies.test/icons.test.tsxcovers the precedence of map, resolver and built-in icons.e2e/icons.spec.tschecks that host icons replace the built-in ones in the DOCX, XLSX and PPTX chrome.bun run typecheck,bun testand the e2e suite pass in CI.🤖 Generated with Claude Code