Repository navigation
Content CSS Phase 11: theming guide for blocks and cleanup - #219
Conversation
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)
| 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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
|
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)
…-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
* 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
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.
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:
Every token, with its default:
--block-bottom-spacing, the container widths,--block-float-max-size);--block-*-background,--block-separator-color,--block-table-border-color, …);--code-token-*syntax colors and thehljs-*classes each one covers;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
baselayer.Docs fixes
add-on-styles-loader.md: the override example used a.block-image__captionpart that doesn't exist. It now uses the callout's real rule and token, and links to the new guide.block-anatomy.md:block-video, but since Content CSS Phase 7: remove the Plate media nodes from Aurora's presets #215 Aurora has no native video node; it's now generic.__link,__item,__image).Upgrade guide
docs/upgrade-guide/plone-aurora.mdgets a section for 1.0.0-alpha.19, "Block content is styled instyles/content.css". It has one subsection per breaking change of #199 and #200, each with aversionadded,versionchangedorversionremovedadmonition:cmsuilayer is removed, andplone-contentis added toconfig.settings.cssLayers(Move the Tailwind reset out of the top cascade layer in the CMS UI (#199 A1) #203);styles/content.cssentry point, and the editor'scontent-arearoot (Add the styles/content.css entry point to the add-on styles loader (#199 A2) #204, Move the image block and inner container styles to styles/content.css (#199 A3) #205);EditorViewandPlateRendererdon't takevariant(Content CSS Phase 8: structural blocks and content root to styles/content.css #216).Nothing was deprecated first: the changes take effect directly, and the guide says so. The media removal fragments are now
breaking, and thevariantremoval has its ownbreakingfragment.Wording
The block docs and the plate
AGENTS.mdsay "Plate.js blocks" instead of "native" blocks, as suggested in review. Other docs pages are tracked in #231.Cleanup
BlockInnerContainermerges its classes withclsx, notcn:cnistwMerge. The content code's other Tailwind helpers (cn,cva) went away in Phases 2–8.EditorStatic'scva. Only the stockfullpreset'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/storybooklink.Ploneterm 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:tsandeslint: 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.