Skip to content

refactor(editor): tokenise selection/image overlay accents (styling Phase 4)#166

Merged
mhurhangee merged 1 commit into
mainfrom
refactor/editor-styling-deinline
Jul 1, 2026
Merged

refactor(editor): tokenise selection/image overlay accents (styling Phase 4)#166
mhurhangee merged 1 commit into
mainfrom
refactor/editor-styling-deinline

Conversation

@mhurhangee

Copy link
Copy Markdown
Owner

Final phase of the styling consolidation. De-inline the genuinely-thematic overlay colours.

What

The selection-overlay rect + image-selection box/handle accents were hardcoded Google-blue (#4285f4 / #2563eb), with #2563eb duplicated (the ACCENT_COLOR const + the drag-ghost literal). Tokenised to --docx-selection-rect / --docx-image-accent (pixel-identical).

Escape-scope care

ACCENT_COLOR (used at the image box/handles) and DEFAULT_SELECTION_COLOR (the rect) are consumed only in CSS inline styles on elements under .ep-root — verified no canvas/non-CSS use — so bare var() resolves. The drag ghost keeps its literal: it's position:fixed on document.body, outside .ep-root, where a token can't resolve (same exception as the print/clipboard fallbacks; now documented in-code).

Deliberately left inline

Structural flex-chrome objects (use-editor-chrome, internals/styles) — layout, not theme; white-handle/black-label overlay chrome — not thematic.

Design question surfaced (not decided)

These overlay accents are Google-blue while text-selection + chrome are emerald (--primary). Now tokens → aligning to emerald is a one-line change if wanted.

Verification

pnpm check green · bun test 1739 pass · both token sites under .ep-root (var resolves); ghost literal preserved.

Completes the consolidation (Phases 0–4). Plan/ledger: living-docs/editor-styling-consolidation.md.

The only genuinely-thematic inline colours left were the selection-overlay rect and
the image-selection box/handle accents — Google-blue, with #2563eb duplicated between
the ACCENT_COLOR const and the drag-ghost literal. Tokenise to --docx-selection-rect /
--docx-image-accent (pixel-identical, both usage sites are under .ep-root so var()
resolves).

The drag ghost keeps its literal — it lives on document.body, outside .ep-root, where
the token can't resolve (same escape-scope exception as the print/clipboard fallbacks;
now documented). Structural flex-chrome objects + white-handle/black-label chrome stay
inline (not thematic). Completes the styling consolidation.
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
patrick-web Ready Ready Preview, Comment Jul 1, 2026 1:27pm

@mhurhangee mhurhangee merged commit 7a9a92a into main Jul 1, 2026
3 checks passed
@mhurhangee mhurhangee deleted the refactor/editor-styling-deinline branch July 1, 2026 13:32
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