-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature parity between FSE Blocks and regular blocks #21087
Comments
For technical implementation, I'd wondered if it might be something to implement as deferring to the implementation of another block. We have some of the pieces of this, e.g. But in most of these cases, is it really much more than Ideally then, the implementation for either the "Site Title" or "Heading" blocks could look something like: function edit() {
useTextAlignment();
useTextColor();
// useHeadingLevel(); // ???
return <RichText { /* ... */ } />;
} (For demonstration only, not a finished API) |
@aduth Personally, I'm leaning more towards expanding the approach used in #21021 to all these customizations which is close to the proposal above with a bit less flexibility (support keys) but more capabilities, touching any part of the block registration/filters. the missing piece is whether we can have something like the "save props" filter on the server to automatically augment the frontend output. |
@youknowriad Yeah, in the context of this issue, I'm not so much concerned about the specific API for reusing common behaviors, but more to the point that we don't need "Site Title" block to be aware of a "Heading" block if each can be mostly recreated with relative ease by opting in to a combination of common components and block functionality. In fact, I'm not much of a fan of using React hooks for this, since one of the requirements of this extensibility is in assigning new attributes to a block type, which is something which should be possible to be made known to the server-side. |
Does this need design feedback here or can we provide feedback on individual PRs? |
We need to map out what tools make sense for each. |
I took a quick look at this to try and surface out what we could have on each block. Default parityBoth the heading and paragraph block have the following: Align: left/centre/right, Text styling: bold, italic, Link, Inline code, Inline image, Strikethrough, Text color. There are also extra options for: Hide Block Settings, Duplicate, Insert Before, Insert After, Edit as HTML, Add to Reusable blocks, Group, Remove Block. FSE blocksI would say the following should exist across all: Align: left/centre/right, Text styling: bold, italic, Text color The ones I am not as sure about would be: Link, Inline code, Inline image, Strikethrough The options probably should exist across all, but I could see an argument for trimming some of those. |
There's a lot of those that don't make sense for the site / post blocks in the context of FSE. All the inline formatting tools, for example, don't make sense because the text is not selectable — only block level changes would apply. |
In light of removing any inline my recommendations then would be: Align: left/centre/right alone. I do wonder about text color changing it all, but that can be later. Options wise I would trim down to maybe just remove block as a starting point. |
I touched on this in my most recent update on the placeholder blocks issue. My thinking was very close to your original list, @mtias, with the exception of Tags and Categories - would those be lists? |
I've added these blocks in #22700 to keep track of the work related to style attributes. |
@karmatosed @mtias I'm starting with the Site Title block. Changing this to use Reading above I'm unclear on what the decision is for support. The text in this block is selectable and editable so reducing to alignment only seems limiting. |
The issue with supporting these formatting options for something like Site Title is WordPress escapes the entities so you get this on the front end: I think we're able to support text alignment via classNames in the wrapper, and also support the changing of the tag used for the title. @mtias mentioned not exposing this in the UI to start. |
Yes, we cannot use rich text here. We can support block-level color tools and font-sizes, though. |
Which alignments and options should be supported for the post-content block? |
What is the reasoning here? Is this a temporary limitation? |
Rich text stores hardcoded HTML entities inline. So the content of the site title might look like One way around it might be to wrap the entire site title in bold or italics. So the content of the site title is |
Just FYI I've updated the issue:
Should we add the experimental colors, font size, line height to all FSE blocks? |
It makes sense for a few blocks like Site Title, Description, tags, categories, etc. Blocks that a user won't have design control of elsewhere. |
With the merge of #24091 we've checked all items for this tracking issue! 🎉 |
Thanks! |
We have several new full site editing blocks that we need to match feature-wise with what regular blocks offer:
The text was updated successfully, but these errors were encountered: