Skip to content

fix: restore editor visual parity after @muyajs/core migration - #4443

Merged
Jocs merged 3 commits into
developfrom
fix/muya-editor-visual-parity
Jun 10, 2026
Merged

Jocs merged 3 commits into
developfrom
fix/muya-editor-visual-parity

Conversation

@Jocs

@Jocs Jocs commented Jun 10, 2026

Copy link
Copy Markdown
Member

After the @muyajs/core engine migration (#4406) the desktop editor picked up the new engine's .mu-* design language, which diverged from the legacy marktext look in several places. This restores parity. Three self-contained commits:

1. fix(desktop) — first-paragraph top spacing + bottom scroll buffer

The legacy #ag-editor-id padding no longer matched the new .mu-container, so the first block sat ~20px too close to the top and the doc lost its 100vh bottom scroll buffer. Restored on .editor-component .mu-container.

2. fix(muya) — render toolbar/copy icons (overflow:auto → hidden)

The drop-shadow icon trick shifts the source PNG off-screen. overflow: auto on the tiny icon box let the desktop's global ::-webkit-scrollbar styling force a classic, space-taking scrollbar that filled the ~14px box (a gray square), hiding the table-column toolbar, code/math copy and other icons. The muya examples were unaffected (no scrollbar styling → macOS overlay scrollbars). All icon i.icon boxes now use overflow: hidden, matching the already-correct inline-format toolbar.

3. fix(muya) — block-level content styling parity across themes

Match the legacy muyajs look on the new .mu-* DOM:

  • paragraph/block spacing → collapsing margin: 0.5em 0 (was non-collapsing padding, which doubled the gap)
  • headings → margin: 1rem 0
  • divider → 2px dashed, vertically centred
  • list indent → 30px
  • blockquote → 0 30px padding + 2px bar at left:15px, full height
  • task-list checked marker → --theme-color + selection glow; loose checkbox top: 0.3em

Colours flow through the existing per-theme camelCase→kebab variable bridge, so this applies uniformly across all 32 themes.

Verification

  • stylelint clean on the changed muya CSS (0 errors).
  • Side-by-side old-engine vs new-engine render (Electron 42, solarized-light): paragraph/heading spacing, list indent, blue checked checkbox, dashed divider and blockquote bar all match.

Open question (not addressed here)

The new engine colours bullet ::markers with --list-marker-color (theme accent), whereas the old engine left them text-coloured. Left as-is since it's a deliberate themable feature, not clearly a regression — happy to revert to text-coloured bullets if preferred.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

Build artifacts for PR #4443:

Run: https://github.com/marktext/marktext/actions/runs/27270915848

Artifact Size Link
marktext-windows-arm64 256.3 MB Download
marktext-macos-x64 256.9 MB Download
marktext-windows-x64 257.6 MB Download
marktext-linux 556.5 MB Download
marktext-macos-arm64 246.7 MB Download

Jocs and others added 3 commits June 10, 2026 18:41
…oll buffer

After the @muyajs/core migration (#4406) the legacy `#ag-editor-id` padding no
longer matched the new `.mu-container`, so the first block sat ~20px too close
to the top and the document lost its 100vh bottom scroll buffer. Restore both
on `.editor-component .mu-container`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…flow:hidden

The drop-shadow icon technique shifts the source PNG off-screen and projects a
recoloured silhouette back into view. `overflow: auto` on the icon box let the
host app's global `::-webkit-scrollbar` styling force a classic, space-taking
scrollbar that filled the ~14px box (rendering as a gray square) and hid the
table-column toolbar, code/math copy and several other icons. The muya examples
were unaffected because they don't style scrollbars (macOS overlay scrollbars
take no space).

Switch every icon `i.icon` box to `overflow: hidden`, matching the already
-correct inline-format toolbar.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Match the legacy muyajs look on the new `.mu-*` DOM:
- paragraph/block spacing back to collapsing `margin: 0.5em 0` (was non-collapsing
  `padding: 0.5em 0`, which doubled the gap between blocks)
- headings to `margin: 1rem 0`
- divider (thematic break) to 2px dashed, vertically centred
- ordered/bullet/task list indent to 30px
- blockquote to `0 30px` padding + 2px bar at left:15px, full height
- task-list checked marker to `--theme-color` + selection glow; loose checkbox
  top back to 0.3em; drop the engine's extra `li padding-left`

Colours flow through the existing per-theme camelCase->kebab variable bridge,
so this applies uniformly across all themes.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@Jocs
Jocs force-pushed the fix/muya-editor-visual-parity branch from d21ab16 to e029713 Compare June 10, 2026 10:46
@Jocs
Jocs merged commit fcd8f39 into develop Jun 10, 2026
16 checks passed
@Jocs
Jocs deleted the fix/muya-editor-visual-parity branch June 10, 2026 11:20
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