refactor(editor): tokenise selection/image overlay accents (styling Phase 4)#166
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
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#2563ebduplicated (theACCENT_COLORconst + 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) andDEFAULT_SELECTION_COLOR(the rect) are consumed only in CSS inline styles on elements under.ep-root— verified no canvas/non-CSS use — so barevar()resolves. The drag ghost keeps its literal: it'sposition:fixedondocument.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 checkgreen ·bun test1739 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.