WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.52k stars 4.21k forks source link

Tracking: Typography Design Tools Consistency #43242

Open aaronrobertshaw opened 2 years ago

aaronrobertshaw commented 2 years ago

Overview

This issue details the current state of typography block support or design tool adoption across all blocks as well as tasks required to fill any gaps. Overall design tool consistency efforts are being tracked via the parent issue: https://github.com/WordPress/gutenberg/issues/43241.

Known Issues

Legend

Value Description
āœ… šŸ‘€ Feature has been adopted and is visible by default control
āœ… Feature has been adopted but is an optional control
āš  There is a bug or issue with this block support feature's adoption
āŒ Feature has been explicitly opted out of
<PR#> Links to PR adopting the feature for this block
- Feature has not explicitly been adopted/omitted
šŸ›  Implemented via an ad hoc / bespoke control
šŸš§ Work is in progress towards adopting this feature (no PR yet)
šŸš« Block support will not be adopted for this block
ā³ Adoption of block supports is pending block refactoring

Block Support Adoption

Note: Deprecated blocks have been omitted from this table. e.g. Comment Author Avatar, Post Comment & Text Columns.

Block Font Size Line Height Font Style Font Weight Text Transform Letter Spacing Font Family Text Decoration Writing Mode
Archives āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Audio šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš«
Avatar šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš«
Button āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Buttons āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Calendar āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… šŸš«
Categories āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Code āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Column āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Columns āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Comment Author Name āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Comment Content āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Comment Date āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Comment Edit Link āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Comment Reply Link āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Comment Template āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Comments āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Comments Pagination āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Comments Pagination Next āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Comments Pagination Numbers āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Comments Pagination Previous āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Comments Title āœ… šŸ‘€ āœ… āœ… šŸ‘€ āœ… šŸ‘€ āœ… āœ… āœ… šŸ‘€ āœ…
Cover āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Details āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Embed šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš«
File - - - - - - - -
Footnotes āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Gallery šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš«
Group āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Heading āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Home Link - Navigation āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
HTML šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš«
Image šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš«
Latest Comments āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Latest Posts āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
List āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
List Item āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Login/logout āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Media & Text āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
More (Read More) - - - - - - - -
Navigation āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Navigation Link āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Navigation Submenu - - - - - - - -
Next Page (Page Break) - - - - - - - -
Page List āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Paragraph āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Post Author āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Post Author Biography āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Post Author Name āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Post Comments Count āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Post Comments Form āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… - -
Post Comments Link āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Post Content āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Post Date āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Post Excerpt āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Post Featured Image šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš«
Post Navigation Link āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Post Template āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Post Terms āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Post Title āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Preformatted āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Pullquote āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Query šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš«
Query No Results āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Query Pagination āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Query Pagination Next āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Query Pagination Numbers āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Query Pagination Previous āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Query Title āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Quote āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Read More āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
RSS - - - - - - - -
Search āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Separator šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš«
Shortcode šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš«
Site Logo šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš«
Site Tagline āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Site Title āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Social Link šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš«
Social Links šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš«
Spacer šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš«
Table āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Table of Contents āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Tag Cloud šŸš« āœ… āœ… āœ… āœ… āœ… āœ… šŸš«
Term Description āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Time To Read āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Verse āœ… šŸ‘€ āœ… āœ… āœ… āœ… āœ… āœ… āœ… āœ…
Video šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš« šŸš«

Merged PRs

The following list details all the PRs merged as part of this effort to increase typography support.

Click to expand list of merged PRs - https://github.com/WordPress/gutenberg/pull/31623 - https://github.com/WordPress/gutenberg/pull/34064 - https://github.com/WordPress/gutenberg/pull/34070 - https://github.com/WordPress/gutenberg/pull/34142 - https://github.com/WordPress/gutenberg/pull/35324 - https://github.com/WordPress/gutenberg/pull/35422 - https://github.com/WordPress/gutenberg/pull/35507 - https://github.com/WordPress/gutenberg/pull/35595 - https://github.com/WordPress/gutenberg/pull/37456 - https://github.com/WordPress/gutenberg/pull/39642 - https://github.com/WordPress/gutenberg/pull/39835 - https://github.com/WordPress/gutenberg/pull/41378 - https://github.com/WordPress/gutenberg/pull/42328 - https://github.com/WordPress/gutenberg/pull/43252 - https://github.com/WordPress/gutenberg/pull/43253 - https://github.com/WordPress/gutenberg/pull/43254 - https://github.com/WordPress/gutenberg/pull/43255 - https://github.com/WordPress/gutenberg/pull/43256 - https://github.com/WordPress/gutenberg/pull/43257 - https://github.com/WordPress/gutenberg/pull/43262 - https://github.com/WordPress/gutenberg/pull/43263 - https://github.com/WordPress/gutenberg/pull/43264 - https://github.com/WordPress/gutenberg/pull/43266 - https://github.com/WordPress/gutenberg/pull/43286 - https://github.com/WordPress/gutenberg/pull/43287 - https://github.com/WordPress/gutenberg/pull/43289 - https://github.com/WordPress/gutenberg/pull/43288 - https://github.com/WordPress/gutenberg/pull/43290 - https://github.com/WordPress/gutenberg/pull/43291 - https://github.com/WordPress/gutenberg/pull/43298 - https://github.com/WordPress/gutenberg/pull/43307 - https://github.com/WordPress/gutenberg/pull/43308 - https://github.com/WordPress/gutenberg/pull/43310 - https://github.com/WordPress/gutenberg/pull/43311 - https://github.com/WordPress/gutenberg/pull/43312 - https://github.com/WordPress/gutenberg/pull/43314 - https://github.com/WordPress/gutenberg/pull/43316 - https://github.com/WordPress/gutenberg/pull/43317 - https://github.com/WordPress/gutenberg/pull/43318 - https://github.com/WordPress/gutenberg/pull/43319 - https://github.com/WordPress/gutenberg/pull/43321 - https://github.com/WordPress/gutenberg/pull/43338 - https://github.com/WordPress/gutenberg/pull/43339 - https://github.com/WordPress/gutenberg/pull/43340 - https://github.com/WordPress/gutenberg/pull/43341 - https://github.com/WordPress/gutenberg/pull/43342 - https://github.com/WordPress/gutenberg/pull/43343 - https://github.com/WordPress/gutenberg/pull/43344 - https://github.com/WordPress/gutenberg/pull/43345 - https://github.com/WordPress/gutenberg/pull/43346 - https://github.com/WordPress/gutenberg/pull/43452 - https://github.com/WordPress/gutenberg/pull/43499 - https://github.com/WordPress/gutenberg/pull/43509 - https://github.com/WordPress/gutenberg/pull/43540 - https://github.com/WordPress/gutenberg/pull/43542 - https://github.com/WordPress/gutenberg/pull/43551 - https://github.com/WordPress/gutenberg/pull/43552 - https://github.com/WordPress/gutenberg/pull/43555 - https://github.com/WordPress/gutenberg/pull/43556 - https://github.com/WordPress/gutenberg/pull/43559 - https://github.com/WordPress/gutenberg/pull/43565 - https://github.com/WordPress/gutenberg/pull/43567 - https://github.com/WordPress/gutenberg/pull/43568 - https://github.com/WordPress/gutenberg/pull/43569 - https://github.com/WordPress/gutenberg/pull/43934 - https://github.com/WordPress/gutenberg/pull/43935 - https://github.com/WordPress/gutenberg/pull/43969 - https://github.com/WordPress/gutenberg/pull/43972 - https://github.com/WordPress/gutenberg/pull/43974 - https://github.com/WordPress/gutenberg/pull/44003 - https://github.com/WordPress/gutenberg/pull/44005 - https://github.com/WordPress/gutenberg/pull/43452 - https://github.com/WordPress/gutenberg/pull/49257 - https://github.com/WordPress/gutenberg/pull/50822 - https://github.com/WordPress/gutenberg/pull/62727

PRs with pending questions, discussions, or concerns

...

Blocks where we're making a conscious decision to skip Typography support

Block Reason
Audio Application of typography styles would mess with the balance between the track progress, icons etc
Avatar Avatar's don't have a caption or textual elements to style
HTML While contents of this block might benefit from styling, the custom HTML only gets a wrapper block to apply typography styles to in the editor, which is also wrapped in an iframe sandbox. There are also no guarantees for the custom HTML to have a single wrapping element we could attempt to inject styles into either.
Post Feature Image There's no caption for the post feature image block so typography styles don't make sense here.
Separator Typography styles won't impact this block.
Site Logo Another image block with no caption and therefore no need for typography support
Social Link There's little that would apply from typography styles to this block. Line height might be the only one. Skipping typography support as that might be better handled via a height control/support. Height should also be uniform across children of the parent Social Links block.
Social Links Similar to above. Typography styles don't make a lot of sense on this block. Height would be better handled via a control dedicated to that.
Spacer There's no typography within the block. Height is controlled explicitly so even line-height wouldn't make sense

Captioned Blocks

There are several blocks which only have a caption as an inner textual element. While it is possible to adopt typography supports for these, there have been explorations towards implementing a Caption block that could be used as an inner block. Adopting typography supports now would likely mean needing to maintain their classes and styles or add extra deprecations should a Caption block land. Additionally, some captioned blocks add their own styles around captions that would override or conflict with those provided by the typography supports.

The current thinking is that we'll postpone any block support adoption here until after 6.1 as that will provide a window to revisit a dedicated Caption block, refactors, and explorations for more complicated blocks such as the Gallery block, which still might benefit from typography supports (so users have a single place to set all the caption styles for its inner images).

The captioned blocks to be revisited after 6.1 are;

Planned Follow-ups

Possible Follow-ups

annezazu commented 2 years ago

Related issue: https://github.com/WordPress/gutenberg/issues/42646 cc @ndiego as a heads up!

ndiego commented 2 years ago

This is great, thanks @aaronrobertshaw just closed out mine in favor of this issue. Let's fill out this table! I'm happy to pick off a few if you want help Aaron.

gziolo commented 2 years ago

I see a big number of PRs adding a similar changes to core blocks:

"typography": {
    "fontSize": true,
    "lineHeight": true,
    "__experimentalFontFamily": true,
    "__experimentalFontWeight": true,
    "__experimentalFontStyle": true,
    "__experimentalTextTransform": true,
    "__experimentalTextDecoration": true,
    "__experimentalLetterSpacing": true,
    "__experimentalDefaultControls": {
        "fontSize": true
    }
 }

I'm all in for consistency, so this is a great effort that I greatly appreciate. Excellent work championing that!


I have two questions related to the changes proposed:

  1. Should we promote all experimental typography options to stable now that they are going to be used with most of the blocks?
  2. Are there any differences in how typography is configured for the blocks that use it? Should we introduce a shorthand so we don't have to repeat the most popular setting like "typography": true or "typography": "default"?
aaronrobertshaw commented 2 years ago

Thanks for checking in on this @gziolo šŸ‘

I see a big number of PRs adding a similar changes to core blocks:

šŸ¤ž I hope the number isn't too many, too fast. We decided that it would be best to split all the adoptions up so each could be treated on its merits and any problem blocks didn't derail the whole process.

I have two questions related to the changes proposed:

Those are great questions.

Should we promote all experimental typography options to stable now that they are going to be used with most of the blocks?

This has crossed my mind and was on the radar. I've explicitly added it within the final phase of these design tool consistency efforts.

Screen Shot 2022-08-18 at 3 43 37 pm

Are there any differences in how typography is configured for the blocks that use it? Should we introduce a shorthand so we don't have to repeat the most popular setting like "typography": true or "typography": "default"?

I don't think any of the differences would prevent us from adopting a shorthand config. Those blocks that want the default supports but wish to skip serialization of the styles or set their own feature level selector would only need to use the current longhand config.

We might also need to tweak the automatic doc generation etc.

I'll add this to the tracking issue as well.

bph commented 2 years ago

Added needs dev note label in case typography supports makes it into 6.1 - this table is very helpful. šŸ™‚šŸ‘

ndiego commented 2 years ago

Are there any differences in how typography is configured for the blocks that use it? Should we introduce a shorthand so we don't have to repeat the most popular setting like "typography": true or "typography": "default"?

I would love to see something like this for both theme.json and block.json. A shorthand that allows you to turn everything on or everything off rather than having to specify each setting individually.

aaronrobertshaw commented 2 years ago

I would love to see something like this for both theme.json and block.json.

@ndiego you might already be aware, but there is a setting for theme.json that allows quick opt-in to all the standard supports, appearanceTools.

While I would also love to have a shorthand config option available at the moment, it obviously makes a lot of sense for the work outlined in this issue, I'm cautious that it might derail or block our current efforts to improve consistency which was one of the goals outlined in the 6.1 roadmap.

There's not a lot of time left before code freeze so I'm inclined towards the shorthand being a very nice to have feature, if we can get to it. Failing that, I'm sure it could be something for the next release.

aaronrobertshaw commented 2 years ago

An overall update on progress towards design tools consistency has been added to the primary tracking issue, including our goals for WordPress 6.1.

aaronrobertshaw commented 2 years ago

I've updated this tracking issue's description to include a brief section on "Captioned Blocks" and why we won't be adopting typography supports for them just yet.

TL;DR

t-hamano commented 1 year ago

Update:

bacoords commented 1 year ago

Is anyone aware of a similar issue but for adding more of the typography design tools to the supports for custom blocks? (As of writing, custom blocks only support fontSize and lineHeight)

t-hamano commented 1 year ago

You should be able to opt-in to various features not only in core blocks but also in custom blocks using properties with the __experimental prefix. For example, various features supported by the Paragraph block could also be opted-in to a custom block.

Note that this may be an experimental property. Previously, an article was posted about experimental APIs. I don't know exactly how experimental features that are already in the core will be handled in the future, but you may need to be careful when using them.

markhowellsmead commented 4 months ago

Adding full typography controls to Audio, Embed, Gallery, Image, Login/logout, Post Featured Image, Tag Cloud and Video would make sense. In particular, allowing the user to control the typography of the media caption for a specific block instance.

t-hamano commented 3 months ago

Update: I have updated the table with the latest specs.

At the same time, I also added the wirtingMode support column. We need to also consider whether we can add this support, except for blocks that already have it and blocks that clearly do not need it.

It is also worth noting that three new block support additions have been proposed:

aaronrobertshaw commented 3 months ago

Thanks for updating this one @t-hamano šŸ™‡

There's a few too many revisions to go through on the issue description. Can you link any PRs for what changed under the merged PRs section? It helps others tracking these efforts.

t-hamano commented 3 months ago

I've rechecked all the core blocks and added all the PRs that added typography support to the merged PRs list šŸ‘