Skip to content
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

Typography block support: add typography support and defaults #34064

Merged
merged 6 commits into from
Nov 3, 2021

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Aug 13, 2021

Resolves: #35604

What this PR does

This PR is a follow-up to #33744, which updates typography controls to use the very excellent ToolsPanel.

We're trying to achieve the following:

  • Opt-in to typography design tools for text blocks. The tools will appear in the ToolsPanel and will be toggleable. Try saying that 10 times fast.
  • Assign useful ToolsPanels "defaults", which are typography tools that will show (and always show) by default.

Testing

Get comfortable.

Rebase this branch on top of origin/update/typography-support-to-use-new--panel

Create a new post and insert the follow blocks:

  • Button
  • Code
  • Heading
  • List
  • Navigation
  • Paragraph
  • Post Author
  • Post Comments
  • Post Comments Count
  • Post Comments Form
  • Post Comments Link
  • Post Date
  • Post Excerpt
  • Post Categories (Post terms block)
  • Post Tags (Post terms block)
  • Post Title
  • Preformatted
  • Query Pagination (next and previous blocks)
  • Query Title
  • Site Tagline
  • Site Title
  • Term Description
  • Verse

For each block, please check that:

  1. The Typography controls appear in the ToolsPanel and,
  2. The properties defined under __experimentalDefaultControls in the block's block.json are displayed in the panel by default.
  3. Take a small break, think of something nice, like cheese.

Screenshots

Lo! The Verse block opts in to fontSize only!

Screen Shot 2021-08-13 at 3 37 41 pm

The paragraph opts in to both fontSize and lineHeight. WOOT!

Screen Shot 2021-08-13 at 3 37 09 pm

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@ramonjd ramonjd added the [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi label Aug 13, 2021
@ramonjd ramonjd self-assigned this Aug 13, 2021
@ramonjd ramonjd added the [Status] In Progress Tracking issues with work in progress label Aug 13, 2021
@ramonjd ramonjd marked this pull request as draft August 13, 2021 05:49
@ramonjd ramonjd removed the request for review from ajitbohra August 13, 2021 05:49
@apeatling
Copy link
Contributor

Looks good -- but why no line height on list and preformatted?

@ramonjd
Copy link
Member Author

ramonjd commented Aug 13, 2021

Thanks for testing!

Looks good -- but why no line height on list and preformatted?

At the time, there wasn't a clear answer as to whether we should include line height for blocks that do not yet explicitly support in the typography settings.

I thought it safer to only add defaults for the current settings until there was a requirement or direction, or at least until we can do a spot of design testing.

A more recent comment from @jasmussen in the Typography: Switch to ToolsPanel for display UI PR seems to support that view.

Happy to give line height support a quick test for these blocks as well if we'd like to enable it immediately. I don't expect too much trouble from such a property.

There's also the option to go with currently-defined properties as defaults and follow up after testing/consultation.

@ramonjd ramonjd removed the [Status] In Progress Tracking issues with work in progress label Aug 16, 2021
@ramonjd ramonjd force-pushed the update/typography-supports-panel-default-controls branch from b591fcf to 1fef971 Compare August 16, 2021 00:45
@ramonjd
Copy link
Member Author

ramonjd commented Aug 16, 2021

Rebasing this PR, I noticed that the post date block has introduced __experimentalFontWeight.

For that block in particular, I don't think it looks too busy with the fontWeight enabled as well. It could be useful since there are no inline controls to adjust font weight for that block.

Post date block with fontWeight controls
Screen Shot 2021-08-16 at 10 44 57 am

Post date block without fontWeight controls
Screen Shot 2021-08-16 at 10 44 42 am

@github-actions
Copy link

Size Change: +869 B (0%)

Total Size: 1.03 MB

Filename Size Change
build/block-editor/index.min.js 119 kB +315 B (0%)
build/block-editor/style-rtl.css 13.9 kB +26 B (0%)
build/block-editor/style.css 13.9 kB +26 B (0%)
build/block-library/index.min.js 147 kB +105 B (0%)
build/components/index.min.js 209 kB +25 B (0%)
build/components/style-rtl.css 15.7 kB -5 B (0%)
build/components/style.css 15.7 kB -6 B (0%)
build/edit-site/index.min.js 26.3 kB +383 B (+1%)
ℹ️ View Unchanged
Filename Size
build/a11y/index.min.js 931 B
build/admin-manifest/index.min.js 1.09 kB
build/annotations/index.min.js 2.7 kB
build/api-fetch/index.min.js 2.19 kB
build/autop/index.min.js 2.08 kB
build/blob/index.min.js 459 B
build/block-directory/index.min.js 6.21 kB
build/block-directory/style-rtl.css 1.01 kB
build/block-directory/style.css 1.01 kB
build/block-library/blocks/archives/editor-rtl.css 61 B
build/block-library/blocks/archives/editor.css 60 B
build/block-library/blocks/archives/style-rtl.css 65 B
build/block-library/blocks/archives/style.css 65 B
build/block-library/blocks/audio/editor-rtl.css 58 B
build/block-library/blocks/audio/editor.css 58 B
build/block-library/blocks/audio/style-rtl.css 111 B
build/block-library/blocks/audio/style.css 111 B
build/block-library/blocks/audio/theme-rtl.css 125 B
build/block-library/blocks/audio/theme.css 125 B
build/block-library/blocks/block/editor-rtl.css 161 B
build/block-library/blocks/block/editor.css 161 B
build/block-library/blocks/button/editor-rtl.css 474 B
build/block-library/blocks/button/editor.css 474 B
build/block-library/blocks/button/style-rtl.css 605 B
build/block-library/blocks/button/style.css 604 B
build/block-library/blocks/buttons/editor-rtl.css 315 B
build/block-library/blocks/buttons/editor.css 315 B
build/block-library/blocks/buttons/style-rtl.css 370 B
build/block-library/blocks/buttons/style.css 370 B
build/block-library/blocks/calendar/style-rtl.css 207 B
build/block-library/blocks/calendar/style.css 207 B
build/block-library/blocks/categories/editor-rtl.css 84 B
build/block-library/blocks/categories/editor.css 83 B
build/block-library/blocks/categories/style-rtl.css 79 B
build/block-library/blocks/categories/style.css 79 B
build/block-library/blocks/code/style-rtl.css 90 B
build/block-library/blocks/code/style.css 90 B
build/block-library/blocks/code/theme-rtl.css 131 B
build/block-library/blocks/code/theme.css 131 B
build/block-library/blocks/columns/editor-rtl.css 194 B
build/block-library/blocks/columns/editor.css 193 B
build/block-library/blocks/columns/style-rtl.css 474 B
build/block-library/blocks/columns/style.css 475 B
build/block-library/blocks/cover/editor-rtl.css 666 B
build/block-library/blocks/cover/editor.css 670 B
build/block-library/blocks/cover/style-rtl.css 1.23 kB
build/block-library/blocks/cover/style.css 1.23 kB
build/block-library/blocks/embed/editor-rtl.css 488 B
build/block-library/blocks/embed/editor.css 488 B
build/block-library/blocks/embed/style-rtl.css 400 B
build/block-library/blocks/embed/style.css 400 B
build/block-library/blocks/embed/theme-rtl.css 124 B
build/block-library/blocks/embed/theme.css 124 B
build/block-library/blocks/file/editor-rtl.css 300 B
build/block-library/blocks/file/editor.css 300 B
build/block-library/blocks/file/style-rtl.css 255 B
build/block-library/blocks/file/style.css 255 B
build/block-library/blocks/file/view.min.js 322 B
build/block-library/blocks/freeform/editor-rtl.css 2.44 kB
build/block-library/blocks/freeform/editor.css 2.44 kB
build/block-library/blocks/gallery/editor-rtl.css 707 B
build/block-library/blocks/gallery/editor.css 706 B
build/block-library/blocks/gallery/style-rtl.css 1.05 kB
build/block-library/blocks/gallery/style.css 1.05 kB
build/block-library/blocks/gallery/theme-rtl.css 122 B
build/block-library/blocks/gallery/theme.css 122 B
build/block-library/blocks/group/editor-rtl.css 159 B
build/block-library/blocks/group/editor.css 159 B
build/block-library/blocks/group/style-rtl.css 57 B
build/block-library/blocks/group/style.css 57 B
build/block-library/blocks/group/theme-rtl.css 93 B
build/block-library/blocks/group/theme.css 93 B
build/block-library/blocks/heading/editor-rtl.css 152 B
build/block-library/blocks/heading/editor.css 152 B
build/block-library/blocks/heading/style-rtl.css 76 B
build/block-library/blocks/heading/style.css 76 B
build/block-library/blocks/home-link/style-rtl.css 247 B
build/block-library/blocks/home-link/style.css 247 B
build/block-library/blocks/html/editor-rtl.css 283 B
build/block-library/blocks/html/editor.css 284 B
build/block-library/blocks/image/editor-rtl.css 728 B
build/block-library/blocks/image/editor.css 728 B
build/block-library/blocks/image/style-rtl.css 482 B
build/block-library/blocks/image/style.css 487 B
build/block-library/blocks/image/theme-rtl.css 124 B
build/block-library/blocks/image/theme.css 124 B
build/block-library/blocks/latest-comments/style-rtl.css 284 B
build/block-library/blocks/latest-comments/style.css 284 B
build/block-library/blocks/latest-posts/editor-rtl.css 137 B
build/block-library/blocks/latest-posts/editor.css 137 B
build/block-library/blocks/latest-posts/style-rtl.css 528 B
build/block-library/blocks/latest-posts/style.css 527 B
build/block-library/blocks/list/style-rtl.css 63 B
build/block-library/blocks/list/style.css 63 B
build/block-library/blocks/media-text/editor-rtl.css 266 B
build/block-library/blocks/media-text/editor.css 263 B
build/block-library/blocks/media-text/style-rtl.css 488 B
build/block-library/blocks/media-text/style.css 485 B
build/block-library/blocks/more/editor-rtl.css 431 B
build/block-library/blocks/more/editor.css 431 B
build/block-library/blocks/navigation-link/editor-rtl.css 474 B
build/block-library/blocks/navigation-link/editor.css 474 B
build/block-library/blocks/navigation-link/style-rtl.css 94 B
build/block-library/blocks/navigation-link/style.css 94 B
build/block-library/blocks/navigation/editor-rtl.css 1.69 kB
build/block-library/blocks/navigation/editor.css 1.69 kB
build/block-library/blocks/navigation/style-rtl.css 1.65 kB
build/block-library/blocks/navigation/style.css 1.64 kB
build/block-library/blocks/navigation/view.min.js 2.52 kB
build/block-library/blocks/nextpage/editor-rtl.css 395 B
build/block-library/blocks/nextpage/editor.css 395 B
build/block-library/blocks/page-list/editor-rtl.css 310 B
build/block-library/blocks/page-list/editor.css 310 B
build/block-library/blocks/page-list/style-rtl.css 242 B
build/block-library/blocks/page-list/style.css 242 B
build/block-library/blocks/paragraph/editor-rtl.css 157 B
build/block-library/blocks/paragraph/editor.css 157 B
build/block-library/blocks/paragraph/style-rtl.css 248 B
build/block-library/blocks/paragraph/style.css 248 B
build/block-library/blocks/post-author/editor-rtl.css 210 B
build/block-library/blocks/post-author/editor.css 210 B
build/block-library/blocks/post-author/style-rtl.css 182 B
build/block-library/blocks/post-author/style.css 181 B
build/block-library/blocks/post-comments-form/style-rtl.css 140 B
build/block-library/blocks/post-comments-form/style.css 140 B
build/block-library/blocks/post-comments/style-rtl.css 360 B
build/block-library/blocks/post-comments/style.css 359 B
build/block-library/blocks/post-content/editor-rtl.css 138 B
build/block-library/blocks/post-content/editor.css 138 B
build/block-library/blocks/post-excerpt/editor-rtl.css 73 B
build/block-library/blocks/post-excerpt/editor.css 73 B
build/block-library/blocks/post-excerpt/style-rtl.css 69 B
build/block-library/blocks/post-excerpt/style.css 69 B
build/block-library/blocks/post-featured-image/editor-rtl.css 412 B
build/block-library/blocks/post-featured-image/editor.css 412 B
build/block-library/blocks/post-featured-image/style-rtl.css 143 B
build/block-library/blocks/post-featured-image/style.css 143 B
build/block-library/blocks/post-template/editor-rtl.css 99 B
build/block-library/blocks/post-template/editor.css 98 B
build/block-library/blocks/post-template/style-rtl.css 378 B
build/block-library/blocks/post-template/style.css 379 B
build/block-library/blocks/post-terms/style-rtl.css 73 B
build/block-library/blocks/post-terms/style.css 73 B
build/block-library/blocks/post-title/style-rtl.css 60 B
build/block-library/blocks/post-title/style.css 60 B
build/block-library/blocks/preformatted/style-rtl.css 103 B
build/block-library/blocks/preformatted/style.css 103 B
build/block-library/blocks/pullquote/editor-rtl.css 198 B
build/block-library/blocks/pullquote/editor.css 198 B
build/block-library/blocks/pullquote/style-rtl.css 361 B
build/block-library/blocks/pullquote/style.css 360 B
build/block-library/blocks/pullquote/theme-rtl.css 167 B
build/block-library/blocks/pullquote/theme.css 167 B
build/block-library/blocks/query-pagination-numbers/editor-rtl.css 122 B
build/block-library/blocks/query-pagination-numbers/editor.css 121 B
build/block-library/blocks/query-pagination/editor-rtl.css 270 B
build/block-library/blocks/query-pagination/editor.css 262 B
build/block-library/blocks/query-pagination/style-rtl.css 168 B
build/block-library/blocks/query-pagination/style.css 168 B
build/block-library/blocks/query-title/editor-rtl.css 85 B
build/block-library/blocks/query-title/editor.css 85 B
build/block-library/blocks/query/editor-rtl.css 131 B
build/block-library/blocks/query/editor.css 132 B
build/block-library/blocks/quote/style-rtl.css 169 B
build/block-library/blocks/quote/style.css 169 B
build/block-library/blocks/quote/theme-rtl.css 220 B
build/block-library/blocks/quote/theme.css 222 B
build/block-library/blocks/rss/editor-rtl.css 202 B
build/block-library/blocks/rss/editor.css 204 B
build/block-library/blocks/rss/style-rtl.css 289 B
build/block-library/blocks/rss/style.css 288 B
build/block-library/blocks/search/editor-rtl.css 165 B
build/block-library/blocks/search/editor.css 165 B
build/block-library/blocks/search/style-rtl.css 374 B
build/block-library/blocks/search/style.css 375 B
build/block-library/blocks/search/theme-rtl.css 64 B
build/block-library/blocks/search/theme.css 64 B
build/block-library/blocks/separator/editor-rtl.css 99 B
build/block-library/blocks/separator/editor.css 99 B
build/block-library/blocks/separator/style-rtl.css 250 B
build/block-library/blocks/separator/style.css 250 B
build/block-library/blocks/separator/theme-rtl.css 172 B
build/block-library/blocks/separator/theme.css 172 B
build/block-library/blocks/shortcode/editor-rtl.css 474 B
build/block-library/blocks/shortcode/editor.css 474 B
build/block-library/blocks/site-logo/editor-rtl.css 462 B
build/block-library/blocks/site-logo/editor.css 464 B
build/block-library/blocks/site-logo/style-rtl.css 153 B
build/block-library/blocks/site-logo/style.css 153 B
build/block-library/blocks/site-tagline/editor-rtl.css 86 B
build/block-library/blocks/site-tagline/editor.css 86 B
build/block-library/blocks/site-title/editor-rtl.css 84 B
build/block-library/blocks/site-title/editor.css 84 B
build/block-library/blocks/social-link/editor-rtl.css 165 B
build/block-library/blocks/social-link/editor.css 165 B
build/block-library/blocks/social-links/editor-rtl.css 812 B
build/block-library/blocks/social-links/editor.css 811 B
build/block-library/blocks/social-links/style-rtl.css 1.33 kB
build/block-library/blocks/social-links/style.css 1.33 kB
build/block-library/blocks/spacer/editor-rtl.css 307 B
build/block-library/blocks/spacer/editor.css 307 B
build/block-library/blocks/spacer/style-rtl.css 48 B
build/block-library/blocks/spacer/style.css 48 B
build/block-library/blocks/table/editor-rtl.css 471 B
build/block-library/blocks/table/editor.css 472 B
build/block-library/blocks/table/style-rtl.css 481 B
build/block-library/blocks/table/style.css 481 B
build/block-library/blocks/table/theme-rtl.css 188 B
build/block-library/blocks/table/theme.css 188 B
build/block-library/blocks/tag-cloud/style-rtl.css 146 B
build/block-library/blocks/tag-cloud/style.css 146 B
build/block-library/blocks/template-part/editor-rtl.css 636 B
build/block-library/blocks/template-part/editor.css 635 B
build/block-library/blocks/template-part/theme-rtl.css 101 B
build/block-library/blocks/template-part/theme.css 101 B
build/block-library/blocks/term-description/editor-rtl.css 90 B
build/block-library/blocks/term-description/editor.css 90 B
build/block-library/blocks/text-columns/editor-rtl.css 95 B
build/block-library/blocks/text-columns/editor.css 95 B
build/block-library/blocks/text-columns/style-rtl.css 166 B
build/block-library/blocks/text-columns/style.css 166 B
build/block-library/blocks/verse/style-rtl.css 87 B
build/block-library/blocks/verse/style.css 87 B
build/block-library/blocks/video/editor-rtl.css 571 B
build/block-library/blocks/video/editor.css 572 B
build/block-library/blocks/video/style-rtl.css 173 B
build/block-library/blocks/video/style.css 173 B
build/block-library/blocks/video/theme-rtl.css 124 B
build/block-library/blocks/video/theme.css 124 B
build/block-library/common-rtl.css 832 B
build/block-library/common.css 830 B
build/block-library/editor-rtl.css 9.38 kB
build/block-library/editor.css 9.37 kB
build/block-library/reset-rtl.css 527 B
build/block-library/reset.css 527 B
build/block-library/style-rtl.css 9.78 kB
build/block-library/style.css 9.79 kB
build/block-library/theme-rtl.css 688 B
build/block-library/theme.css 692 B
build/block-serialization-default-parser/index.min.js 1.09 kB
build/block-serialization-spec-parser/index.min.js 2.79 kB
build/blocks/index.min.js 47 kB
build/compose/index.min.js 10.2 kB
build/core-data/index.min.js 12.3 kB
build/customize-widgets/index.min.js 10.4 kB
build/customize-widgets/style-rtl.css 1.5 kB
build/customize-widgets/style.css 1.49 kB
build/data-controls/index.min.js 614 B
build/data/index.min.js 7.03 kB
build/date/index.min.js 31.5 kB
build/deprecated/index.min.js 428 B
build/dom-ready/index.min.js 304 B
build/dom/index.min.js 4.53 kB
build/edit-navigation/index.min.js 13.4 kB
build/edit-navigation/style-rtl.css 3.1 kB
build/edit-navigation/style.css 3.1 kB
build/edit-post/classic-rtl.css 492 B
build/edit-post/classic.css 494 B
build/edit-post/index.min.js 28.4 kB
build/edit-post/style-rtl.css 7.18 kB
build/edit-post/style.css 7.17 kB
build/edit-site/style-rtl.css 5.01 kB
build/edit-site/style.css 5.01 kB
build/edit-widgets/index.min.js 15.9 kB
build/edit-widgets/style-rtl.css 4.01 kB
build/edit-widgets/style.css 4.02 kB
build/editor/index.min.js 37.5 kB
build/editor/style-rtl.css 3.92 kB
build/editor/style.css 3.91 kB
build/element/index.min.js 3.16 kB
build/escape-html/index.min.js 517 B
build/format-library/index.min.js 5.36 kB
build/format-library/style-rtl.css 668 B
build/format-library/style.css 669 B
build/hooks/index.min.js 1.55 kB
build/html-entities/index.min.js 424 B
build/i18n/index.min.js 3.59 kB
build/is-shallow-equal/index.min.js 501 B
build/keyboard-shortcuts/index.min.js 1.49 kB
build/keycodes/index.min.js 1.25 kB
build/list-reusable-blocks/index.min.js 1.85 kB
build/list-reusable-blocks/style-rtl.css 838 B
build/list-reusable-blocks/style.css 838 B
build/media-utils/index.min.js 2.88 kB
build/notices/index.min.js 845 B
build/nux/index.min.js 2.03 kB
build/nux/style-rtl.css 747 B
build/nux/style.css 743 B
build/plugins/index.min.js 1.83 kB
build/primitives/index.min.js 921 B
build/priority-queue/index.min.js 582 B
build/react-i18n/index.min.js 671 B
build/redux-routine/index.min.js 2.63 kB
build/reusable-blocks/index.min.js 2.28 kB
build/reusable-blocks/style-rtl.css 256 B
build/reusable-blocks/style.css 256 B
build/rich-text/index.min.js 10.6 kB
build/server-side-render/index.min.js 1.32 kB
build/shortcode/index.min.js 1.48 kB
build/token-list/index.min.js 562 B
build/url/index.min.js 1.72 kB
build/viewport/index.min.js 1.02 kB
build/warning/index.min.js 248 B
build/widgets/index.min.js 6.27 kB
build/widgets/style-rtl.css 1.04 kB
build/widgets/style.css 1.04 kB
build/wordcount/index.min.js 1.04 kB

compressed-size-action

@apeatling
Copy link
Contributor

At the time, there wasn't a clear answer as to whether we should include line height for blocks that do not yet explicitly support in the typography settings.

I would have expected list item to support line height, but based on Joen's comment we could leave it out and come back to it.

@ramonjd ramonjd force-pushed the update/typography-supports-panel-default-controls branch 3 times, most recently from 2e81026 to 36ca314 Compare August 29, 2021 23:09
@ramonjd ramonjd force-pushed the update/typography-supports-panel-default-controls branch from 36ca314 to 1e56e35 Compare October 7, 2021 03:31
"__experimentalFontWeight": true,
"__experimentalDefaultControls": {
"fontSize": true,
"lineHeight": true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add "weight" as a default and remove line-height

@ramonjd
Copy link
Member Author

ramonjd commented Nov 1, 2021

I think we should remove font family and then talk to Matías on the call tomorrow to see about following up with this in another PR? Alternatively you could wait until tomorrow and ask him.

We removed font-family in a previous commit, but it broke several blocks validations: #35604 (comment)

My proposal was to leave font-family for the blocks where font-family already exists and then, if we decide to remove it for these blocks, follow up with individual PRs for each deprecation (around eight).

@francescamarano
Copy link

@ramonjd I think this is looking good, I think we should remove font family and then talk to Matías on the call tomorrow to see about following up with this in another PR? Alternatively you could wait until tomorrow and ask him.

Hello 👋 Is the call with Matias a call for Gutenberg contributors? Thanks

@ramonjd
Copy link
Member Author

ramonjd commented Nov 2, 2021

Ciao @francescamarano! I think it's a quick, on-the-fly sort of thing, so not a formal contributor meeting. Anything we learn will be posted right here. Thanks!

@apeatling
Copy link
Contributor

@francescamarano It's an informal meet and greet for our team. Not specific to Gutenberg or this PR. Anything related to it that comes up we'll post here in detail. 👍

Copy link
Contributor

@andrewserong andrewserong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @ramonjd, thanks for working through all these! They're testing well for me. I've noted that a couple of the blocks behave in slightly awkward ways (e.g. it'd be great to have more granular control over typography within elements of the block), but I don't think any of these are blockers for getting this PR merged.

The one issue that we might want to tweak, is that the post comments count block currently opts-in to text transform, but since it always renders a number, I think that might not be necessary?

My full testing notes are below. Apologies for the big list!

✅ Button block: Font size shown by default
✅ Code block: Font size shown by default, all others working well
✅ Heading block: font size, appearance, text transform shown by default, all others working well
✅ List block: font size shown by default, all others working well
✅ Navigation block: font size shown by default, all others working well
✅ Paragraph block: font size shown by default, all others working well
✅ Post author block: font size shown by default, all others working well
✅ Post comment date block: font size shown by default, all others working well
✅ Post comments count block: font size shown by default, all others working well except text transform which might not make sense if it's always just a number? ❓
❓ Post comments form block: mostly works but the nested h3 element doesn't get targeted by some of the Typography settings set at the container — left a note, but likely things to be followed up with separately for that block
✅ Post comments link: font size shown by default, all others working well
❓ Post comments block: mostly works but I ran into a similar issue as with the Post comments form block: it's a more complex block, so applying the Typography controls at the container level applies to all elements within it. But, since it's server-rendered, it's maybe not such a big issue to have it enabled
✅ Post date block: font size shown by default, all others working well
✅ Post excerpt block: font size shown by default, all others working well
✅ Post navigation block: font size shown by default, all others working well
✅ Post terms block: font size shown by default, all others working well
✅ Post title block: font size, appearance, letter case shown by default, all others working well
✅ Pre-formatted block: font size shown by default, all others working well
✅ Pullquote block: font size and appearance shown by default, all others working well
✅ Query pagination next block: font size shown by default, all others working well
✅ Query pagination prev block: font size shown by default, all others working well
✅ Query title block: font size, font appearance, text transform shown by default, all others working well
✅ Quote block: font size and appearance shown by default, all others working well
✅ Site tagline block: font size shown by default, all others working well
✅ Site title block: font size, line height, appearance, letter spacing, text transform shown by default, font family also works well
❓ Table block: all the opted-in settings work, but because we don't have separate typography controls for table heading versus content and footer, is it an issue that we're setting all these at the container level? I could imagine folks finding it frustrating that they can't control these things separately... but I suppose it's better to expose some control than none!
✅ Term description block: Font size shown by default, line height can be accessed
✅ Verse block: Font size and appearance shown by default, all others working well

As I mentioned, I think some of these questions would be good things to explore in follow-ups over time, but not blockers for getting this larger PR merged in the shorter-term 👍

packages/block-library/src/post-comments-count/block.json Outdated Show resolved Hide resolved
"lineHeight": true
"lineHeight": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found font weight and font size, etc, didn't quite work as I expected with this block, because it's a more complex block. E.g. the font weight gets applied at the container, but there is a nested h3 that doesn't wind up being affected by this:

image

Because this is a server-rendered block, I wouldn't consider these details a blocker — I think personally it's fine to opt-in to these Typography supports and defer fine-tuning the behaviour to follow-ups further down the track.

since the rendered output is a number
@ramonjd
Copy link
Member Author

ramonjd commented Nov 3, 2021

Thanks again for the always helpful review, and the eagle eyes.

❓ Table block: all the opted-in settings work, but because we don't have separate typography controls for table heading versus content and footer, is it an issue that we're setting all these at the container level? I could imagine folks finding it frustrating that they can't control these things separately... but I suppose it's better to expose some control than none!

This is what I found, and also came to the same conclusion as you: the typography controls are nice to have, but it seems like another one of those blocks that demand finer control over the inner elements.

🤷

Post comments block: mostly works but I ran into a similar issue as with the Post comments form block: it's a more complex block, so applying the Typography controls at the container level applies to all elements within it. But, since it's server-rendered, it's maybe not such a big issue to have it enabled

Post comments form block: mostly works but the nested h3 element doesn't get targeted by some of the Typography settings set at the container — left a note, but likely things to be followed up with separately for that block

I'll work on immediate follow ups for these. 🍺

@apeatling
Copy link
Contributor

apeatling commented Nov 3, 2021

@francescamarano The main points that came up in a chat with Matías about this:

  • We should keep font family as an option if it exists, but it should not be the default for any blocks
  • We don't yet have a good way to add custom fonts, so it's quite limited.
  • Once we have a better fonts API we can surface this more in blocks that are more likely to need font family changes (site title being an obvious one).

@ramonjd ramonjd merged commit 1b0ff7e into trunk Nov 3, 2021
@ramonjd ramonjd deleted the update/typography-supports-panel-default-controls branch November 3, 2021 20:52
@github-actions github-actions bot added this to the Gutenberg 11.9 milestone Nov 3, 2021
@francescamarano
Copy link

@francescamarano The main points that came up in a chat with Matías about this:

  • We should keep font family as an option, but it should not be the default for any blocks
  • We don't yet have a good way to add custom fonts, so it's quite limited.
  • Once we have a better fonts API we can surface this more in blocks that are more likely to need font family changes (site title being an obvious one).

Thanks! Hopefully, the Webfonts API will make it to WP 6.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typography Tools: Tracking defaults for blocks
6 participants