Block content: settle the visual quirks kept for zero diff in #200

Open
#227 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
css, javascript
Domain
design, frontend

Research direction

Read the four linked issues (#213, #214, #216, #217) and confirm the visual decisions before starting; each proposed change is conditional. The relevant files are packages/plate/styles/content.css, packages/plate/components/ui/table-node.tsx, and packages/agave/styles/publicui.css and content.css. After an approved change, run the “Update VRT Screenshots” workflow; done means the chosen editor/public-view behavior is reflected in the affected screenshots.

Written by the indexing model from the issue text.

Description

The block content conversion (#200) was kept pixel-identical on purpose, so a few existing quirks were reproduced instead of fixed. Each one below is a small change, but each changes the look, so they need a decision first. They're grouped here so they can be decided together, and each one can then land as its own small PR with its own visual diff.

1. Code block syntax colors that never applied (#213)

Tailwind turned _ into a space inside the arbitrary variants of the old code block classes. So two GitHub-theme rules never matched:

  • .hljs-built_in (orange, #e36209): built-ins such as console get no color;
  • .hljs-variable.language_ (red, #d73a49): this and similar get the variable blue instead.

packages/plate/styles/content.css reproduces what rendered, so it has no rule for either. Fix: add .hljs-built_in to the --code-token-symbol rule, and .hljs-variable.language_ to the --code-token-keyword rule.

2. Table header cells are bold only in the editor (#214)

The rendered content sets header cells to normal weight. The editor never did, so the browser's bold applied there. To stay zero-diff, the editable TableCellElement in packages/plate/components/ui/table-node.tsx adds font-bold to header cells, with a comment. Fix: decide on one weight. Either remove that class, which makes the editor match the page, or make headers bold in content.css, which makes the page match the editor.

3. The toggle chevron looks interactive in the public view (#216)

In the rendered content, .block-toggle__icon keeps the hover background and pointer cursor it had, but clicking it does nothing: the static toggle is always open. Fix: drop the cursor and the :hover rule from the static icon in content.css, or make the static toggle collapsible.

4. Heading typography differs between the editor and the public view (#217)

Since #217, blocks are spaced the same in both UIs. Headings still look different, because Agave's heading styles (.content-area .block h2, h3, the title) are in packages/agave/styles/publicui.css, which only loads in the Public UI. Fix: move Agave's content typography to packages/agave/styles/content.css, so the editor shows headings as visitors see them.

After each change, the affected screenshots need the "Update VRT Screenshots" workflow.

Dominant language
JavaScript
Stars
10
Forks
9
Avg merge
4d 7h
Merged PRs (30d)
54

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from plone/aurora

All issues in plone/aurora

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.