Skip to content

Content CSS Phase 11: theming guide for blocks and cleanup - #219

Merged
sneridagh merged 8 commits into
b10-plone-blocksfrom
b11-docs-cleanup
Oct 6, 2026
Merged

sneridagh merged 8 commits into
b10-plone-blocksfrom
b11-docs-cleanup

Conversation

@sneridagh

@sneridagh sneridagh commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Phase 11 of #200, the last one: a theming guide for blocks, fixed docs examples, and the last Tailwind helper left in content code. No visual change.

Stacked on #218 (Phase 10). The base is b10-plone-blocks. This PR's own change is only the last commit.

Changes

New how-to: "Style blocks in a theme"

docs/how-to-guides/style-blocks-in-a-theme.md, linked from the how-to index, covers:

  • Where block styles go: an add-on's styles/content.css, loaded in both the Public UI and the editor. It links to the authoring rules in the styles loader guide (Content CSS architecture: cascade layers, reset placement, and a shared block-styles entry point #199).

  • Two ways to change a block: set a token on .content-area (preferred), or override a rule, since the framework rules have zero specificity.

  • The hooks: block root, Plate node, inner part and variant.

  • Every block's parts and variants:

    • native blocks: paragraph and lists, headings, blockquote, separator, code block, table, callout, toggle, columns, table of contents, and inline elements;
    • Plone blocks: image, video, teaser, listing and maps.
  • Every token, with its default:

    • layout (--block-bottom-spacing, the container widths, --block-float-max-size);
    • native blocks (--block-*-background, --block-separator-color, --block-table-border-color, …);
    • all --code-token-* syntax colors and the hljs-* classes each one covers;
    • the theme values the framework reads with fallbacks.

    It also names the internal properties a theme shouldn't set.

  • Examples: dark code blocks via prefers-color-scheme, and a callout override.

  • Resets: a theme's own reset belongs in the base layer.

Docs fixes

  • add-on-styles-loader.md: the override example used a .block-image__caption part that doesn't exist. It now uses the callout's real rule and token, and links to the new guide.
  • block-anatomy.md:
  • Vale: the accept list gets "blockquote", "callout" and "classname". The docs already used them.

Upgrade guide

docs/upgrade-guide/plone-aurora.md gets a section for 1.0.0-alpha.19, "Block content is styled in styles/content.css". It has one subsection per breaking change of #199 and #200, each with a versionadded, versionchanged or versionremoved admonition:

Nothing was deprecated first: the changes take effect directly, and the guide says so. The media removal fragments are now breaking, and the variant removal has its own breaking fragment.

Wording

The block docs and the plate AGENTS.md say "Plate.js blocks" instead of "native" blocks, as suggested in review. Other docs pages are tracked in #231.

Cleanup

  • BlockInnerContainer merges its classes with clsx, not cn: cn is twMerge. The content code's other Tailwind helpers (cn, cva) went away in Phases 2–8.
  • Kept on purpose: EditorStatic's cva. Only the stock full preset's export and AI chat use it, which makes it chrome.

Validation

  • make docs-html: builds. The 6 warnings are all pre-existing: news fragments outside a toctree, and a /storybook link.
  • Vale on the changed pages: no new errors. The remaining ones are the vocabulary's pre-existing Plone term pattern, flagged on every page.
  • CI=1 pnpm visual-test --retries=0: 26/26 pixel-identical.
  • pnpm acceptance-test: 182 passed.
  • pnpm --filter @plone/plate test --run: 75 passed. check:ts and eslint: clean.

With this, the phases of #200 are complete. What's left is the review and merge order of the stack, and the VRT baseline updates noted in #217 and #218.

Part of #200.

A how-to guide with every block's parts and tokens, fixed content styles examples, and BlockInnerContainer uses clsx instead of the Tailwind-aware cn.

Closes the conversion phases of #200.
* b10-plone-blocks:
  Move the table drag handle fragment to @plone/quanta
  Releasing @plone/aurora 1.0.0-alpha.16
  Release @plone/contents 1.0.0-alpha.3
  Release @plone/publicui 1.0.0-alpha.8
  Release @plone/cmsui 1.0.0-alpha.11
  Release @plone/agave 1.0.0-alpha.8
  Release @plone/theming 1.0.0-alpha.8
  Release @plone/layout 1.0.0-alpha.13
  Release @plone/blocks 1.0.0-alpha.17
  Release @plone/plate 1.0.0-alpha.22
  Release @plone/react-router 2.0.0-alpha.7
  Release @plone/helpers 2.0.0-alpha.9
  Release @plone/registry 4.0.0-alpha.4
  Release @plone/quanta 1.0.0-alpha.1
  Release @plone/components 5.0.0-alpha.5
  Release @plone/client 2.0.0-alpha.8
  Release @plone/icons 1.0.0-alpha.1
  Release @plone/types 3.0.0-alpha.7
  Split Quanta and icons out of @plone/components into @plone/quanta and @plone/icons (#212)
Comment thread docs/development/block-anatomy.md Outdated
For example, both video blocks get `block-video`.
Use `.block-video.slate-video` for the native one, `.block-video.slate-ploneBlock` for the Plone one, or `.block-video` for both.
Both then get `block-<type>`.
Use `.block-<type>.slate-<type>` for the native one, `.block-<type>.slate-ploneBlock` for the Plone one, or `.block-<type>` for both.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the word "native" here and just say Plate block (what is native depends on context and assumptions).

Why do the classes say slate instead of plate?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will take note and do a full pass at the end.
The base plate libraries use this convention, leaving slate naming in the classnames. Change it would be painful, I think it's fine...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in ecabff0: the block anatomy doc and the new "Style blocks in a theme" guide now say "Plate.js blocks" instead of "native" blocks. That includes the older "Plate-native" mentions in the block anatomy doc, so the page is consistent. Other docs pages that say "Plate-native" aren't part of this stack; they can get the same pass separately.

* b10-plone-blocks:
  Keep EditorView as the Tailwind-free content root
What's native depends on context, as noted in review.
One section per breaking change of #199 and #200, with versionadded, versionchanged and versionremoved admonitions for 1.0.0-alpha.17. The media node removal fragments are breaking, and the removed variant prop of EditorView and PlateRenderer gets its own fragment. The plate AGENTS.md says Plate.js block instead of native block.
@sneridagh

Copy link
Copy Markdown
Member Author

LGTM

* b10-plone-blocks:
  Releasing @plone/aurora 1.0.0-alpha.18
  Release @plone/plate 1.0.0-alpha.24
  Remove unused @plone/quanta dependency from @plone/plate (#236)
  Releasing @plone/aurora 1.0.0-alpha.17
  Release @plone/plate 1.0.0-alpha.23
  Fix caret jumping to the title after inserting a Plone block (#235)
1.0.0-alpha.17 and 1.0.0-alpha.18 were released without these changes.
* b10-plone-blocks:
  Remove the Plate media nodes from Aurora's presets (#215)
  Move the table styles to styles/content.css (#214)
  Move the code block styles to styles/content.css (#213)
  Move the list styles to styles/content.css (#211)
  Move the inline mark styles to styles/content.css (#210)
  Move the text block styles to styles/content.css (#209)
  Add h1 and hr to the Plate block anatomy (#208)
  Add the block content classname contract foundations (#206)
  Move the image block and inner container styles to styles/content.css (#199 A3) (#205)
  Add the styles/content.css entry point to the add-on styles loader (#204)
  Move the Tailwind reset out of the top cascade layer in the CMS UI (#199 A1) (#203)
@sneridagh
sneridagh added this pull request to stack #238 October 6, 2026 15:13
@sneridagh
sneridagh merged commit f1bf3f2 into main Oct 6, 2026
52 of 53 checks passed
@sneridagh
sneridagh deleted the b11-docs-cleanup branch October 6, 2026 15:14
sneridagh added a commit that referenced this pull request Oct 6, 2026
…-width

* origin/main: (67 commits)
  Releasing @plone/aurora 1.0.0-alpha.19
  Release @plone/cmsui 1.0.0-alpha.12
  Release @plone/agave 1.0.0-alpha.9
  Release @plone/theming 1.0.0-alpha.9
  Release @plone/layout 1.0.0-alpha.14
  Release @plone/blocks 1.0.0-alpha.18
  Release @plone/plate 1.0.0-alpha.25
  Release @plone/registry 4.0.0-alpha.5
  Release @plone/quanta 1.0.0-alpha.2
  Content CSS Phase 11: theming guide for blocks and cleanup (#219)
  Rename the Plone blocks' classnames to the content contract (#218)
  Share the block spacing between the Public UI and the editor (#217)
  Content CSS Phase 8: structural blocks and content root to styles/content.css (#216)
  Remove the Plate media nodes from Aurora's presets (#215)
  Move the table styles to styles/content.css (#214)
  Move the code block styles to styles/content.css (#213)
  Move the list styles to styles/content.css (#211)
  Move the inline mark styles to styles/content.css (#210)
  Move the text block styles to styles/content.css (#209)
  Add h1 and hr to the Plate block anatomy (#208)
  ...

# Conflicts:
#	packages/plate/components/editor/index.tsx
sneridagh added a commit that referenced this pull request Oct 8, 2026
* origin/main: (190 commits)
  Make control panels saveable (#220)
  Public UI: render a single .content-area root (#230) (#234)
  Remove tsconfig test/spec/story excludes that never matched any file (#222)
  Add PloneClient.extend() and clientEndpoints utility for custom endpoints (#221)
  Store the default block width of every top-level block (#190)
  Releasing @plone/aurora 1.0.0-alpha.19
  Release @plone/cmsui 1.0.0-alpha.12
  Release @plone/agave 1.0.0-alpha.9
  Release @plone/theming 1.0.0-alpha.9
  Release @plone/layout 1.0.0-alpha.14
  Release @plone/blocks 1.0.0-alpha.18
  Release @plone/plate 1.0.0-alpha.25
  Release @plone/registry 4.0.0-alpha.5
  Release @plone/quanta 1.0.0-alpha.2
  Content CSS Phase 11: theming guide for blocks and cleanup (#219)
  Rename the Plone blocks' classnames to the content contract (#218)
  Share the block spacing between the Public UI and the editor (#217)
  Content CSS Phase 8: structural blocks and content root to styles/content.css (#216)
  Remove the Plate media nodes from Aurora's presets (#215)
  Move the table styles to styles/content.css (#214)
  ...

# Conflicts:
#	packages/cmsui/components/BooleanWidget/BooleanWidget.stories.tsx
#	packages/cmsui/components/BooleanWidget/BooleanWidget.test.tsx
#	packages/cmsui/components/BooleanWidget/BooleanWidget.tsx
#	packages/cmsui/news/+boolean-widget-adapter.bugfix
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.

3 participants