Repository navigation
Closed
Labels
Needs Design FeedbackNeeds general design feedback.[Feature] BlocksOverall functionality of blocks[Feature] Design ToolsTools that impact the appearance of blocks both to expand the number of tools and improve the experi
Description
We have several new full site editing blocks that we need to match feature-wise with what regular blocks offer:
- Site Title → Heading (@apeatling) Site Title Block: Add alignment and tag level support #22843, Site Title: Add support settings for colors, fonts, and line height #23007
- Site Tagline → Paragraph (@Copons) Site Tagline Block #23788
- Post Title → Heading (@apeatling @Copons) Post Title Block: Add alignment and heading level support #22872 Post Title Block: Add style attributes #24246
- Post Date → Paragraph (@Copons) Post Date Block: Add style attributes and restructure the edit function #23931
- Post Author → Paragraph (@Addison-Stavlo) Update post author block functionality and visual parity #22877, Update Post Author block to use __experimentalColor and __experimentalLineHeight #23044
- Post Content → Paragraph / Group (@noahtallen, Add alignment support to post content block #24014)
- Post Excerpt → Paragraph (@Addison-Stavlo) Post excerpt block - add color, fontSize, lineHeight, and text alignment. #23945
- Post Tags → Paragraph (@jeyip) Post Tags: Feature Parity for Customization #24069 Post Tags: Fix bug where no tags are rendered #24082
- Post Categories → Paragraph (@Copons) Post Hierarchical Terms Block #24091
- Comments → Paragraph / Group (@Addison-Stavlo) Post Comments block - add style supports for text and background settings. #24080 (follow up: Post Comments Block: Implementation Notes #24101)
- Comment Count → Paragraph (@Copons) Post Comments Counts: Add style attributes #24167
- Comment Form / Reply → Paragraph (@Copons) Post Comments Form: Add style attributes #24162 (follow up: Post Comments Form: Implementation Notes #24221)
Metadata
Metadata
Assignees
Labels
Needs Design FeedbackNeeds general design feedback.[Feature] BlocksOverall functionality of blocks[Feature] Design ToolsTools that impact the appearance of blocks both to expand the number of tools and improve the experi
Activity
aduth commentedon Mar 23, 2020
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.
<BlockEdit />.But in most of these cases, is it really much more than
<RichText />, with a particular configuration? It would be nice if we could leverage components for the shared baseline. The main unknown at this point would be in implementing common attributes, which I think could be addressed as part of proposals of #15450.Ideally then, the implementation for either the "Site Title" or "Heading" blocks could look something like:
(For demonstration only, not a finished API)
youknowriad commentedon Mar 23, 2020
@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.
aduth commentedon Mar 23, 2020
@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.
MichaelArestad commentedon Mar 24, 2020
Does this need design feedback here or can we provide feedback on individual PRs?
mtias commentedon Mar 24, 2020
We need to map out what tools make sense for each.
karmatosed commentedon Mar 30, 2020
I took a quick look at this to try and surface out what we could have on each block.
Default parity
Both 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 blocks
I 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.
mtias commentedon Mar 30, 2020
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.
karmatosed commentedon Mar 30, 2020
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.
dwolfe commentedon Mar 30, 2020
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?
oandregal commentedon May 29, 2020
I've added these blocks in #22700 to keep track of the work related to style attributes.
apeatling commentedon Jun 2, 2020
@karmatosed @mtias I'm starting with the Site Title block. Changing this to use
RichTextcomponent instead ofPlainTextallows the block to support the standard tooling: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.
apeatling commentedon Jun 2, 2020
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.
mtias commentedon Jun 3, 2020
Yes, we cannot use rich text here. We can support block-level color tools and font-sizes, though.
noahtallen commentedon Jun 9, 2020
Which alignments and options should be supported for the post-content block?
MichaelArestad commentedon Jun 10, 2020
What is the reasoning here? Is this a temporary limitation?
noahtallen commentedon Jun 10, 2020
Rich text stores hardcoded HTML entities inline. So the content of the site title might look like
<b>Here is my <i>title!</i></b>. This works fine when rendered in HTML, but the site title is used in a lot of other places. Anything that tries to access the site title would now need to understand and know about those HTML entities, which would be a breaking change. Theoretically, it's possible for anyone to handle the situation by stripping out all the HTML entities after we access the site title, but you'd have to do that everywhere you access it. (Which means it would break 3rd party code.)One way around it might be to wrap the entire site title in bold or italics. So the content of the site title is
Here is my title!, and the site title block allows you to say that the whole thing is bold or italics, and then it render<b><i>Here is my title</i></b>without actually storing those HTML entities in the database. (in the same way the other block-level attributes work.)Copons commentedon Jul 13, 2020
Just FYI I've updated the issue:
Should we add the experimental colors, font size, line height to all FSE blocks?
(Colors might not make sense everywhere though, or might be more involved than just add a support property, e.g. for "linked elements", like the Post Title or Comment Count)
MichaelArestad commentedon Jul 16, 2020
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.
Copons commentedon Aug 26, 2020
With the merge of #24091 we've checked all items for this tracking issue! 🎉
FSE blocks should, can, and will be updated and improved over time, but I'm going to close this issue for now, since the basic requiremens are all complete.
Thanks y'all for the great work!
mtias commentedon Aug 26, 2020
Thanks!