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

Table: Add missing typography supports #43974

Merged
merged 1 commit into from Sep 8, 2022

Conversation

aaronrobertshaw
Copy link
Contributor

@aaronrobertshaw aaronrobertshaw commented Sep 8, 2022

Related:

What?

Adds missing typography supports to the Table block.

Why?

  • Improves consistency of our design tools across blocks.

How?

  • Opts into missing font-family and text-decoration typography support.

Testing Instructions

  1. Edit a post, add a Table block, select it and enter some content.
  2. Check that the font-family and text-decoration controls are now available.
  3. Test various typography settings ensuring styles are applied in the editor.
  4. Save and confirm their application on the frontend.
  5. Test styling via theme.json and global styles (Note: Text decoration is deliberately not available in Global Styles).

Example theme.json snippet:

			"core/table": {
				"typography": {
					"fontFamily": "var(--wp--preset--font-family--source-serif-pro)",
					"textDecoration": "line-through"
				}
			}

Screenshots or screencast

Screen.Recording.2022-09-08.at.7.48.59.pm.mp4

@aaronrobertshaw aaronrobertshaw added [Type] Enhancement A suggestion for improvement. [Block] Table Affects the Table Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] Typography Font and typography-related issues and PRs labels Sep 8, 2022
@aaronrobertshaw aaronrobertshaw self-assigned this Sep 8, 2022
@glendaviesnz
Copy link
Contributor

This all works for me, except text decoration doesn't show in global styles, but was it noted on a previous PR that there is some reason why text decoration doesn't show in global styles?

Copy link
Contributor

@glendaviesnz glendaviesnz left a comment

Choose a reason for hiding this comment

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

LGTM:

✅ Could add font family and text decoration in post editor tools panel and changes were reflected in editor and frontend
✅ Could set font family in global styles and change reflected in site editor, post editor and frontend
✅ Could set font family and text decoration in theme.json and both reflected in editor and frontend

@aaronrobertshaw
Copy link
Contributor Author

Thanks for the review @glendaviesnz 👍

noted on a previous PR that there is some reason why text decoration doesn't show in global styles?

Originally, it was decided that text decoration shouldn't be exposed or encouraged to be set at the global styles level. There are separate plans in the works to update the Global Styles typography panel which may involve adding the text-decoration control at some point.

I'll also update the test instructions here to highlight the lack of text decoration in Global Styles.

@aaronrobertshaw aaronrobertshaw merged commit c7aae90 into trunk Sep 8, 2022
@aaronrobertshaw aaronrobertshaw deleted the add/missing-typography-supports-to-table branch September 8, 2022 23:09
@github-actions github-actions bot added this to the Gutenberg 14.1 milestone Sep 8, 2022
@femkreations femkreations added the Needs User Documentation Needs new user documentation label Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Table Affects the Table Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] Typography Font and typography-related issues and PRs Needs User Documentation Needs new user documentation [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants