Repository navigation
Conversation
The content styles of @plone/plate select Plate's class names, and Volto uses two of them for its own elements: `slate-editor` wraps volto-slate's text editor, and `slate-table` wraps the view of Volto's table block. Their `overflow: hidden` hid the slash menu of Volto's text blocks and stopped them from wrapping around floated images in the editor, and the table block got extra padding in the view. Plate's elements always carry a Slate data attribute, Volto's wrappers don't, so roll back every declaration of the `plone-content` layer for those: they now compute the same styles as without the layer. The acceptance test compares the computed styles of Volto's text editor and table view with and without the layer, and checks that the slash menu is painted. Assisted-by: Claude Opus 5.5
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The content styles of
@plone/plate(styles/content.css, in theplone-contentlayer since 1.0.0-alpha.42) select Plate's class names. Volto uses two of those names for its own elements, so the styles also reached them:slate-editorwraps the editor of Volto's text blocks (volto-slate). Itsoverflow: hiddenclipped the slash menu: typing/showed nothing, and Enter picked a block you couldn't see. It also stopped text blocks from wrapping around floated images in the editor. It added a border radius,cursor: text, and margins on the elements inside too.slate-tablewraps the view of Volto's table block, which got 20px of extra padding above and below.Found in the QA of the intranet upgrade to 1.0.0-alpha.43 (kitconcept/kitconcept.intranet#598).
Fix
Plate's elements always have a Slate data attribute:
data-slate-editoron the editor root (edit and view), anddata-slate-nodeon every element. Volto's wrappers don't. For Volto's elements, a rule in the same layer resets everything the layer sets (all: revert-layer), so they look as if the layer wasn't loaded. It's placed after the import and is more specific than the layer's:where()selectors.I checked every class and attribute that
content.cssselects against Volto core, volto-slate and Volto Light Theme. These are the only overlaps, plusblock-inner-container. That one is shared on purpose:_main.scssalready lays it out the same way for every Volto block.Tests
New acceptance test,
volto-blocks-content-css.test.ts, on a Document with Volto text, list and table blocks:plone-contentlayer.All three tests fail without the fix. The full acceptance suite passes, except
mentions.test.ts:170, which fails locally with and without this change.Also checked in an intranet production build with this
tailwind.css, with these results:Assisted-by: Claude Opus 5.5