-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add font family and text-decoration typography supports to paragraph blocks #39642
Add font family and text-decoration typography supports to paragraph blocks #39642
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @randhirexpresstech! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
Related discussions on typography defaults over at #35604 |
Thanks for working on this @randhirexpresstech. I've added some reviewers who will be more aware of which blocks are ready for which particular features. |
Hi @randhirexpresstech, thank you for working on this. 🥳 There is a minor review comment from my side. Rest of the changes looks good to me. 😃 |
Also I'm not 100% sure if this is out of scope of the current PR or not. It would be really appreciated if we can show what default font is? I'm sharing few screenshots both for paragraph and heading.I got confused why style didn't change when I changed from default font to the same actual font. Another benefit is user will not waste time by selecting same default font again. 😅 |
e251ee9
to
27ebecb
Compare
Thanks @randhirexpresstech, I updated the title accordingly. Generally, it is easier to break out enhancements per block. Can someone point me to the technical issues that are blocking the addition of |
@ndiego, if I'm reading the earlier comments right, the issue to opting-in more blocks to the It looks like the Webfonts API work is being tracked in this issue: #41479 and the programmatic enqueueing is in #40363 and #40386 — if I understand correctly from those issue descriptions, the problem with opting-in prematurely could be that for a user who has access to the control to select the font, when they interact with the control, the font they've selected may not actually be available / enqueued in the editor at that time, so they will not see the appropriate font that they've selected. I haven't been involved in working in that particular area, but just thought I'd share those links in case it helps give a bit more context to the discussions (I've only done a quick read of the issues, I haven't tested out the current state of things yet 🙂) |
@mtias and/or @hellofromtonya would either of you be able to provide any clarification on the discussion above. I assume that for 6.1 we want to have fonts stabilized and at a place where we can enable Currently, we have |
Just created this tracking issue for |
🎉 We've got a green light to add missing typography supports as part of greater efforts to achieve consistency in our design tools. If it interests you, you can track the overall progress towards consistent block support adoption in: #43241. Or, there's a tracking issue specifically for typography supports. With that said, @randhirexpresstech, would you mind updating this PR also to include adding the missing text-decoration support to the paragraph block? i.e. If you are short on time, I'd be happy to push the required changes or create an alternate PR. Thanks! |
The issues with the webfonts API are related to the distinction of setting a font family for a block type and setting it for a block instance. Block instances should only get access to already vetted fonts by the global styles declaration, and users should not be encouraged to setting font-family locally, which is why it should not be visible by default (ellipsis menu) on block instances. For block types, access to font family should be consistent and clear, and we also need to expand the reporting of what blocks are using what font on the global styles typography settings. |
27ebecb
to
8efe6fb
Compare
Thanks @aaronrobertshaw for the good news and providing me such a great opportunity to contribute in WordPress gutenberg repository. I am happy to update this PR to include adding the missing text-decoration support to the paragraph block? i.e. "__experimentalTextDecoration": true, as per requirement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating this PR @randhirexpresstech 👍
This is testing well for me.
✅ Font family and text decoration selections are applied in the block editor
✅ Selections are reflected on the frontend
✅ New controls are not displayed by default (they're only available via the ellipsis menu)
✅ Font family is available by default in the paragraph block's Global Styles panel
Click for block editor demo
Screen.Recording.2022-08-22.at.3.52.15.pm.mp4
Click for Paragraph block's Global Styles panel demo
Screen.Recording.2022-08-22.at.4.03.42.pm.mp4
The failed e2e tests are currently being re-run. When they pass this should almost be ready to land.
@randhirexpresstech It might also help for clarity and posterity if you could update the PR description here to reflect the actual changes in the current version of the PR i.e. make the description about updating the paragraph typography block supports.
Thanks @aaronrobertshaw for approving this PR. As per requirement, I have updated title and description of this PR for more clarity. |
Congratulations on your first merged pull request, @randhirexpresstech! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts: https://profiles.wordpress.org/me/profile/edit/ And if you don't have a WordPress.org account, you can create one on this page: https://login.wordpress.org/register Kudos! |
This PR adds some missing typography like font family and text-decoration supports to paragraph block, which are already available in Gutenberg.
With the help of this PR block theme developers and website admin will have more customization options to create more beautiful website and design patterns.
In some places, designers require to have different typography as compare to global typography like font-family, text-decoration etc. to create unique designs.
In the absence of these typography settings on block level, block theme developers are rely on custom css for these typography options which are not editable by website admin using frontend editor tools. So this PR will provide more flexibility and help admin to get more controls over design and UI elements.
Testing Steps
Please check this screen-cast
For more details please check this comment