Skip to content

SpreadSheet Editor Dark Mode (dark document) 🌘 β€” companion to web-apps PR - #70

Open
j-base64 wants to merge 20 commits into
mainfrom
fix/117-dark-theme-canvas-background
Open

SpreadSheet Editor Dark Mode (dark document) 🌘 β€” companion to web-apps PR#70
j-base64 wants to merge 20 commits into
mainfrom
fix/117-dark-theme-canvas-background

Conversation

@j-base64

@j-base64 j-base64 commented Aug 3, 2026

Copy link
Copy Markdown

Origin

Issue Euro-Office/web-apps#117 pinpoints the lack of dark mode in the spreadsheet editor, unlike the document editor, which already has one.

Originally noticed on web-apps, the fix requires changes to both sdkjs and web-apps, plus optionally DocumentServer for e2e smoke tests.

Approach

This PR brings dark mode (dark document feature) to the spreadsheet editor with a simple starting approach, rather than full negative-inversion or full token-based re-theming:

SSE-DarkMode_ScreenCapture_300729.mp4

What this dark mode DOES βœ…

  • Define & Apply a dark mode colorset to background, text, and border color of cells left on automatic colorsΒΉ
  • Honors print/print preview with an always light theme
  • Sets automatic text to white on cells with an explicit dark background (see Design Notes)
  • Handles:
    • Partially colored text
    • Merged and conditionally-formatted cells
    • Search-highlighted cells
    • Row/column guide color when resizing

Design notes 🌈

  • To maximise compatibility of designed cells in light mode, the automatic text color of cells with an explicit background is computed the same way as in light mode. This led to a design choice: flip automatic text from black to white on darkened cells, so a user isn't surprised to set a black background on a cell and find its text invisible. However, users can override text color with an explicit color. Try it and see.
  • In the future, it probably makes sense to simplify by merging the dark theme and dark document features into one sun/moon-style switch, like many modern products do.

What this dark mode DOESN'T DO ❌

  • Affect inserted elements like images, shapes, charts
  • Fix certain table templates that use transparent instead of white to draw "white" rows
  • Rely on inverting colors of the document (negative method) or the UI color palette
  • Ship on mobile

Known tradeoffs

  • Equations are not supported yet (remains black), should be fixed on an update
  • A cell being actively edited keeps its previous theme's colors until you click away. Prototyped a fix, reverted it, not worth the complexity for a small, self-correcting gap.

ΒΉ Automatic color = different from explicit color (those explicitly set by the user or a table style template)

Basic manual testing

  1. Create content and colorisations on a sheet
    • Type text in a few cells, set an explicit/custom text color on a whole cell, and on just some words or letters within another cell.
    • Add a border to two cells, set explicit/custom border color for one of the cells.
    • Add a predesigned table 5 cols x 5 rows.
  2. Under View tab > Make sure the interface theme is Dark.
  3. Switch Dark Document button to see differences.
  4. In dark mode
    • Search for some text.
    • Resize a column or row. The drag guide should be visible against the dark background.
    • Open Print Preview.

Automated testing

  • Proposed on DocumentServer see below, 13 smoke tests covering cell fill/border/text correction, merged cells, page-break-preview, gradient/pattern fill in the cell editor, print-preview, column-resize guide color, search-highlight contrast, mid-edit-toggle behavior, interface-theme interaction, and toolbar sync

Code

This PR spans BOTH sdkjs, web-apps, and optionally DocumentServer:

AI assistance

  • Developed with AI assistance (Claude Code, mainly claude-sonnet-5)
🌘 First PRs in the project, feedback and reviews welcome :)

j-base64 added 20 commits August 3, 2026 18:19
…web-apps commit too

Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
…mode correction)

Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
- disable isNearBlackOrWhite computation

Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
…rk mode

Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
… computes (no behavior change)

Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
Fix dark-mode cell color bugs, theme-corruption bug, and naming cleanup

- Fix page-break-preview border overlay getting dark-mode corrected twice
- Fix pattern-fill contrast check treating a known cell-editor background as unknown
- Fix interface theme switches silently corrupting content dark mode's cell
  background/grid color (GlobalSkin aliases directly into EditorSkins; the
  interface-skin color harvest was overwriting it in place)
- Rename bIsExplicitFill/isNotCustomColor/misapplied isTextRecolorable locals
  to match what they actually compute (no behavior change)
- Remove redundant/inaccurate comments introduced by this branch

Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
Tune isColorDark threshold and drop a same-session comment

Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: j-base64 <jcentenero@arsys.es>
@j-base64 j-base64 changed the title SpreadSheet Editor Dark Mode (dark document) 🌘 SpreadSheet Editor Dark Mode (dark document) 🌘 β€” companion to web-apps PR Aug 3, 2026
@j-base64
j-base64 requested review from MonaAghili and moodyjmz August 4, 2026 09:13
@j-base64
j-base64 marked this pull request as ready for review August 4, 2026 09:34
@j-base64
j-base64 requested a review from a team as a code owner August 4, 2026 09:34
@j-base64
j-base64 removed the request for review from a team August 4, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant