Skip to content

Migrate edit-site and block-editor UI text to shared primitives #77265

Open

Description

@jameskoster

Now that the required tooling is in place (#64340) and has been allowlisted, we can start applying consistent text styling across the site and block editor. This can be done by replacing instances of __experimentalText and __experimentalHeading, as well as any ad hoc styled text, with the Text component from the UI package.

Note

This todo list with generated with AI assistance and may not be 100% exhaustive.

Migrate existing __experimentalText / __experimentalHeading to @wordpress/ui Text

edit-site

  • Add template suggestion rows — add-new-template/add-custom-template-modal-content.js uses Text for suggestion titles, no-results, instructional paragraphs, button labels.
  • Add template list item — add-new-template/index.js uses Text for template titles.
  • Pagination — pagination/index.js uses Text variant="muted" for totals and page indicator.
  • Legacy add template — add-new-template-legacy/* mirrors the above.

block-editor

  • Block card description — block-card/index.js uses Text for block description. migrated __experimentalText, __experimentalHStack, and __experimentalVStack to Text and Stack #78155
  • Block switcher bindings hint — block-switcher/index.js uses Text inside MenuGroup.
  • Block patterns paging — block-patterns-paging/index.js uses Text variant="muted" for counts/page.
  • Inspector popover header — inspector-popover-header/index.js uses Heading + Text.
  • Block bindings — hooks/block-bindings.js uses Text as="div" variant="muted".
  • Attribute control — block-bindings/attribute-control.js uses Text truncate / variant="muted".
  • Block styles menu items — block-styles/menu-items.js uses Text as="span" with truncate / limit.
  • Pattern overrides dropdown — block-toolbar/pattern-overrides-dropdown.js uses Text for description.
  • Allowed blocks modal — block-allowed-blocks/modal.js uses Text for intro copy.
  • Pattern category previews — inserter/block-patterns-tab/pattern-category-previews.js uses Heading + Text.
  • Shadow panel — global-styles/shadow-panel-components.js uses Heading level={5}.
  • Sidebar navigation screen title — sidebar-navigation-screen/index.js uses __experimentalHeading with size, level, and inline color.

Text component migrations

edit-site

  • Welcome guide headings + body copy — editor.js, page.js, template.js use raw <h1> + <p> with BEM classes (edit-site-welcome-guide__heading / __text). Migrate to Heading + Text.
  • Save panel copy — save-panel/index.js uses <p> wrapping sprintf theme-activation text. Migrate to Text as="p".
  • Sidebar navigation screen description — sidebar-navigation-screen/index.js renders the description prop in a <div>. Migrate to Text. Fixes all routes using this screen (stylebook, main nav, etc.).
  • Pattern sync status label — page-patterns/fields.js uses <span> with class-based sync status styling. Migrate to Text with appropriate variant.
  • Pattern author name — page-patterns/fields.js uses <span className="fields-controls__author-name">. Migrate to Text with truncation.
  • Template author name — page-templates/fields.js duplicates the author name <span> pattern. Migrate to Text with truncation.
  • Site hub title — site-hub/index.js styles the site title via SCSS (font-size, weight, color, manual ellipsis). Migrate to Text with truncation prop.

block-editor

  • Layout constrained helptext — layouts/constrained.js uses <p className="…__layout-constrained-helptext">. Migrate to Text.
  • Grid layout help — layouts/grid.js uses <p className="components-base-control__help">. Migrate to Text.
  • Block hooks helptext — hooks/block-hooks.js uses <p className="…__block-hooks-helptext">. Migrate to Text.
  • List view no blocks message — hooks/list-view.js uses <p className="…__no-blocks">. Migrate to Text.
  • Duotone control description — duotone-control/index.js uses plain <p> for explainer. Migrate to Text. (Duplicated in global-styles/filters-panel.js — centralise.)
  • Duotone filters panel description — global-styles/filters-panel.js duplicates the same <p> explanation. Migrate to Text and share with duotone control.
  • Link control help — link-control/index.js uses <p className="…__help">. Migrate to Text as="p" (preserve id for aria-describedby).
  • Media preview modal copy — inserter/media-tab/media-preview.js uses two <p> elements for external-image warning. Migrate to Text.
  • Block visibility modal descriptions — block-visibility/modal.js uses multiple <p className="…__description"> with createInterpolateElement + <strong>. Migrate to Text.
  • Block removal warning modal — block-removal-warning-modal/index.js uses <p> + <strong> for warning copy. Migrate to Text.
  • Block navigation label — block-navigation/dropdown.js uses <p className="…__label">. Migrate to Text.
  • Warning message — warning/index.js uses <p className="…__message">. Migrate to Text. @kushagra-goyal-14 Refactor warning component to use Text component #78094
  • Text indent control help — text-indent-control/index.js uses <p className="components-base-control__help">. Migrate to Text.
  • URL popover description — url-popover/image-url-input-ui.js uses <p> + <p className="description">. Migrate to Text.
  • Link preview info — link-control/link-preview.js uses <span className="…__preview-info"> + error span. Migrate to Text with appropriate variant.
  • Block card name — block-card/index.js uses <span className="…__name">. Migrate to Text.
  • Variation picker label — block-variation-picker/index.js uses <span className="…__variation-label">. Migrate to Text.
  • Media replace flow label — media-replace-flow/index.js uses <span className="…__image-url-label">. Migrate to Text.
  • Block fields link title — hooks/block-fields/link/index.js uses <span className="…__link-title"> (long URLs — truncation candidate). Migrate to Text with truncation.
  • Block fields media title — hooks/block-fields/media/index.js uses <span className="…__media-title"> (has existing TODO about truncation). Migrate to Text with truncation.
  • Multi-selection card title — multi-selection-inspector/index.js uses <div className="…__card-title">. Migrate to Text or Heading.
  • Pattern list item titles — block-patterns-list/index.js uses <div className="…__item-title">. Migrate to Text. @kushagra-goyal-14 Migrate pattern list item titles to Text from @wordpress/ui #77656
  • Pattern transformations title — block-switcher/pattern-transformations-menu.js uses <div className="…__item-title">. Migrate to Text.
  • Pattern setup title — block-pattern-setup/index.js uses <div className="…__item-title">. Migrate to Text.
  • Patterns filter help — inserter/block-patterns-tab/patterns-filter.js uses <div className="…__patterns-filter-help"> for a body paragraph. Migrate to Text as="p".

Heading component migrations

block-editor

  • Block compare heading — block-compare/block-view.js uses <h2 className="…__heading">. Migrate to Heading.
  • Inserter panel title — inserter/panel.js uses <h2 className="…__panel-title">. Migrate to Heading.
  • Block fields header title — hooks/block-fields/index.js uses <h2 className="…__header-title"> (one branch wraps Truncate). Migrate to Heading.

Activity

  1. added
    [Type] Enhancement
    [Package] Block editor
    [Package] Edit Site
    on Apr 13, 2026
  2. kushagra-goyal-14 commented on Apr 20, 2026

    @kushagra-goyal-14
    Contributor

    Hi @jameskoster
    I’m working through the migration of block-bindings/attribute-control.js and had some questions as it uses truncate, variant="muted", and isDestructive on __experimentalText, none of which have direct equivalents on the new Text.

    • For truncation, is composing __experimentalTruncate via Text's render prop the expected interim pattern, or is there a preferred alternative already?
    • Also, for muted color, should I add a local CSS module using --wpds-color-fg-content-neutral-weak, or is there a shared utility I've missed?
    • For the invalid state — given @wordpress/ui Button: undo destructive tone variant #74540 scoped destructive out of general Button use, should invalid-binding text still render in error color, or is a different treatment preferred?
  3. jameskoster commented on Apr 20, 2026

    @jameskoster
    ContributorAuthor

    @kushagra-goyal-14 I think truncation is a feature we should add to Text, so we might consider any instances dependent on that blocked for now.

    should I add a local CSS module using --wpds-color-fg-content-neutral-weak

    That's the right token, but let's got a confirmation from @WordPress/gutenberg-components.

    should invalid-binding text still render in error color, or is a different treatment preferred?

    Probably okay to maintain roughly the same appearance for now, using a token from the Theme package. --wpds-color-fg-content-error should be available.

  4. aduth commented on Apr 20, 2026

    @aduth
    Member

    @kushagra-goyal-14 I think truncation is a feature we should add to Text, so we might consider any instances dependent on that blocked for now.

    Related: #77391

  5. mirka commented on Apr 20, 2026

    @mirka
    Member

    I think truncation is a feature we should add to Text, so we might consider any instances dependent on that blocked for now.

    Personally I don't think it's a given that truncation features should be included in Text directly, so I wouldn't necessarily block for that.

    should I add a local CSS module using --wpds-color-fg-content-neutral-weak

    That's the right token, but let's got a confirmation from @WordPress/gutenberg-components.

    If we're talking about local styles in edit-site and block-editor, I don't think they're using CSS modules anywhere yet. I think it's fine to stick to normal Sass stylesheets until someone decides to modernize the CSS strategies in those packages.

  6. kushagra-goyal-14 commented on Apr 21, 2026

    @kushagra-goyal-14
    Contributor

    Thanks for the clarification @mirka . I'll use a Sass stylesheet rather than a CSS module for attribute-control.js. Noted that the truncation question isn't settled; I'll wait for a resolution before proceeding on that file.

  7. ciampo commented on Apr 30, 2026

    @ciampo
    Contributor

    @saranshsinhaa @kushagra-goyal-14 @Sukhendu2002 please coordinate your efforts before opening many PRs to make sure you don't overlap on the same item. You may even add your name next to the single bullet point in this issue's description to claim ownership.

  8. mirka commented on Apr 30, 2026

    @mirka
    Member

    Note that in most situations we're going to need before/after screenshots and testing instructions for review.

    Another point is that if there are any differences between the existing typography design and the replacement Text variant, a lot of those are going to require design decisions as to whether we need to keep the exception or we can consolidate to the standard Text variant.

  9. ciampo commented on Apr 30, 2026

    @ciampo
    Contributor

    Note that in most situations we're going to need before/after screenshots and testing instructions for review.

    I'm also going to add that we'll have to close PRs that don't meet those requirements. Reviewing and testing changes can take a considerable amount of time; the least PR authors should do is to prove that they tested their changes in the browser before asking for a review (instead of just throwing an AI agent at the problem), providing screenshots and testing instructions.

    Another point is that if there are any differences between the existing typography design and the replacement Text variant, a lot of those are going to require design decisions as to whether we need to keep the exception or we can consolidate to the standard Text variant.

    Absolutely. I anticipate there will be many of those decisions. My preference would be to always use one of Text presets, which will help ensure a more consistent approach to typography throughout the editor — but we'll realisticaly often need design feedback (more than code feedback).

  10. kushagra-goyal-14 commented on May 8, 2026

    @kushagra-goyal-14
    Contributor

    Can a maintainer please add my name to the following items in the description, as I don't have access to add that?

    I have PRs open for both:
    Warning message (warning/index.js) — #78094
    Pattern list item titles (block-patterns-list/index.js) — #77656

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Package] Block editor[Package] Edit Site[Type] Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions