Skip to content

refactor(editor): relocate stylesheets into docx-editor-react (styling Phase 2) - #163

Merged
mhurhangee merged 2 commits into
mainfrom
refactor/editor-styling-relocate-css
Jul 1, 2026
Merged

mhurhangee merged 2 commits into
mainfrom
refactor/editor-styling-relocate-css

Conversation

@mhurhangee

Copy link
Copy Markdown
Owner

Phase 2 of the styling consolidation (plan: living-docs/editor-styling-consolidation.md). Move-first, behaviour-preserving relocation — the concern-split follows in 2b.

What moved

The two editor stylesheets leave docx-editor-core for docx-editor-react/src/styles/:

  • styles/editor.css → docx-editor-react/src/styles/editor.css (chrome + tokens)
  • prosemirror/editor.css → docx-editor-react/src/styles/prosemirror.css (painter/PM DOM)

Why

CSS is a DOM/client concern; the core/react seam is headless-vs-DOM and CSS never enters the headless server path. So the stylesheets belong in the client package — making "restyle the editor → look in docx-editor-react" literally true.

Wiring (the contract-path change)

  • hidden-prose-mirror now imports prosemirror.css relatively (same package).
  • The frontend imports @eigenpal/docx-editor-react/styles/editor.css (was …-core/styles/editor.css) — the stylesheet export moves off core's package map onto react's. Both exports-map tests updated.
  • Frontend's only direct use of docx-editor-core was that stylesheet, so it's dropped from apps/frontend deps (still present transitively via react/agents; knip enforced this). Lockfile updated.
  • CLAUDE.md (the '5 symbols + 1 stylesheet' path), the READMEs, and stale path comments updated.

Verification

  • pnpm check green (incl. knip) · bun test 1739 pass · rename-detected diff (0 content change on prosemirror.css).
  • CSS-import resolution (the new react package export) is exercised by the Vercel preview build.

CSS is a DOM/client concern, so it belongs in the client package, not core (the
core/react seam is headless-vs-DOM, and CSS never enters the headless server path).
Move-first, behaviour-preserving:

- styles/editor.css + prosemirror/editor.css -> docx-editor-react/src/styles/
  (editor.css chrome, prosemirror.css painter/PM DOM).
- Rewire imports: hidden-prose-mirror uses a relative import; the frontend imports
  @eigenpal/docx-editor-react/styles/editor.css. Move the export off core's package
  map onto react's; update both exports-map tests.
- Frontend's only direct use of docx-editor-core was that stylesheet, so drop the
  now-unused workspace dep (still present transitively via react/agents).
- Update CLAUDE.md (the '5 symbols + 1 stylesheet' path + a stale --docx- mention),
  the READMEs, and stale path comments.

Concern-split of the two files follows in Phase 2b.
@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 12:54pm

…lesheets

The move made prosemirror.css's 'Lives in core' header false (flagged by review);
also drop the now-meaningless 'matches the Vue adapter' rationale from three
editor.css comments (the Vue adapter was removed in the leaning). Dead Vue
scrollbar selectors logged to the plan-doc ledger for a dead-CSS sweep.
@mhurhangee
mhurhangee merged commit 7c5c9de into main Jul 1, 2026
3 checks passed
@mhurhangee
mhurhangee deleted the refactor/editor-styling-relocate-css branch July 1, 2026 12:55

This branch was successfully deployed

1 active deployment
Preview — d26dc5ab Deployed Jul 1, 2026 by vercel[bot]
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