Skip to content

Code editor: Show design system focus ring on the title and content fields - #85468

Draft
R1shabh-Gupta wants to merge 2 commits into
WordPress:trunkfrom
R1shabh-Gupta:fix/code-editor-focus-ring
Draft

R1shabh-Gupta wants to merge 2 commits into
WordPress:trunkfrom
R1shabh-Gupta:fix/code-editor-focus-ring

Conversation

@R1shabh-Gupta

Copy link
Copy Markdown
Contributor

What?

Part of #80138

In the Code editor, the title and content fields now show the same design system focus ring. The title no longer shows a doubled ring.

Why?

  • The title field is a TextareaControl, which already draws the design system ring. The Code editor styles added a box-shadow ring and a theme-colored border on top of it, so it showed two rings.
  • The content field used a legacy box-shadow ring, so the two fields looked different on focus.

How?

  • Removed the title's focus override, so only TextareaControl's own ring shows.
  • The content field uses outset-ring__focus() and resets the border color and box-shadow that wp-admin's forms.css applies on focus, matching how the design system's own text fields work.
  • Removed the content field's border and box-shadow transition and its position: relative, which no longer have any effect.
  • Increased PostTitleRaw's top margin from 2px to calc(2 * var(--wpds-border-width-focus)), so the ring isn't hidden under the sticky "Exit code editor" toolbar.

Testing Instructions

  1. Open a post and switch to the Code editor (⋮ → Code editor).
  2. Click the title field. There should be one ring with a small gap, and the border should stay gray.
  3. Click the content field. It should look the same as the title.
  4. Check the top edge of the title's ring. It should be fully visible below the "Exit code editor" toolbar.
  5. Repeat in the Site Editor with a page.

Testing Instructions for Keyboard

  1. In the Code editor, Tab from the "Exit code editor" button into the title field. It should show the focus ring.
  2. Press Tab again to move to the content field. It should show the same ring.

Screenshots or screencast

Before After

Use of AI Tools

This PR was developed with the assistance of Claude Code.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

@github-actions github-actions Bot added the [Package] Editor /packages/editor label Oct 23, 2026

This branch has not been deployed

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

Labels

[Package] Editor /packages/editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant