UI Text: Mark as recommended#77044
Conversation
|
Size Change: 0 B Total Size: 7.74 MB ℹ️ View Unchanged
|
|
Flaky tests detected in be2b12f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24085420916
|
f40ef60 to
be2b12f
Compare
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| status: 'not-recommended', | ||
| whereUsed: 'global', | ||
| notes: 'Values are not aligned with the current design system. Use [typography tokens](?path=/docs/tokens-typography--page) from `@wordpress/base-styles` instead.', | ||
| notes: 'Use `Text` from `@wordpress/ui` instead, with the `render` prop set to the heading level element and the variant set to the visual heading size (e.g. `<Text render={ <h1 /> } variant="heading-2xl">`).', |
There was a problem hiding this comment.
That is pretty clunky to implement when it's spelled out like this 😅 Maybe a <Heading /> abstraction will be useful to introduce.
There was a problem hiding this comment.
Given that we don't tie the font size with the heading levels anyway, it's still going to be something like <Heading level={ 1 } variant="heading-2xl">. Not that different!

What?
Part of #76135
Adds
Textto the list of recommended components, and updates guidance for the oldText/Headingcomponents to use the newTextinstead.Also removes the
Textcomponent from readme snippets where they're unnecessary.Why?
This should ultimately be enforced with the
use-recommended-componentslint rule. This PR is just a preliminary step to update the docs.Testing Instructions
npm run storybook:dev.Use of AI Tools
Composer 2