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

Post Comments Count: Add missing typography supports #43321

Merged

Conversation

aaronrobertshaw
Copy link
Contributor

Related:

What?

Adds missing typography supports to the Post Comments Count block.

Why?

  • Improves consistency of our design tools across blocks.

How?

  • Opts into missing font-family, text-decoration, and text-transform (only for consistency) typography support.

Testing Instructions

  1. In the site editor, add a Post Comments Count block to a template e.g Index page's posts.
  2. Navigate to Global Styles > Blocks > Post Comments Count > Typography.
  3. Apply a different font family and save.
  4. Confirm font family style is applied to the count on the frontend.

Screenshots or screencast

Screen.Recording.2022-08-17.at.8.51.31.pm.mp4

@aaronrobertshaw aaronrobertshaw added [Type] Enhancement A suggestion for improvement. [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Block] Post Comments Count Affects the Post Comments Count Block [Feature] Typography Font and typography-related issues and PRs labels Aug 17, 2022
@aaronrobertshaw aaronrobertshaw self-assigned this Aug 17, 2022
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.

These are all working nicely for me at the individual block level and in global styles 👍

Not sure if this helps for our thinking surrounding the Cover block's placeholder, but one of the things I noticed with the placeholder / warning state for this block, is that the only style that "breaks through" to the placeholder is the text decoration, as all the other settings are reset by the .block-editor-warning class. I wonder if we can do something similar with the placeholder components for other blocks?

image

This LGTM, I don't think the text decoration breaking through to the placeholder state is a blocker for merging. 🎉

@aaronrobertshaw
Copy link
Contributor Author

Thanks for the review and attention to detail @andrewserong 👍

I wonder if we can do something similar with the placeholder components for other blocks?

I'll add two follow-ups to the typography support consistency tracking issue. One for adding text decoration to the .block-editor-warning reset. The other for handling placeholders such as the one for the Cover block.

@carolinan
Copy link
Contributor

Question: Since this will always display a number, does letter casing / text transform matter?

@aaronrobertshaw
Copy link
Contributor Author

Question: Since this will always display a number, does letter casing / text transform matter?

Thanks for the question @carolinan.

I would say yes. Some languages do have what are referred to as uppercase numbers, e.g. Chinese. Also, some fonts can define "uppercase" numbers even for English; see the Miller typeface. Such fonts basically offer different style, lining, and tabular natures between lower and uppercase numbers.

"Lowercase":

一(1),二(2) ,三(3),四(4),五(5),六(6),七(7),八(8),九(9),十(10),百(100),千(1000)

"Uppercase":

壹(1)贰(2)叁(3)肆(4)伍(5)陆(6)柒(7)捌(8)玖(9)拾(10)佰(100)仟(1000)

Disclaimer: I have very little knowledge about Chinese characters and am happy for others with more to chime in on this.

@aaronrobertshaw aaronrobertshaw merged commit 49cf0ab into trunk Aug 19, 2022
@aaronrobertshaw aaronrobertshaw deleted the add/missing-typography-supports-to-post-comments-count branch August 19, 2022 00:11
@github-actions github-actions bot added this to the Gutenberg 14.0 milestone Aug 19, 2022
@femkreations femkreations added the Needs User Documentation Needs new user documentation label Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Comments Count Affects the Post Comments Count 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.

4 participants