Skip to content

Base Styles: Remove accent color parameter from input-control - #80595

Merged
mirka merged 8 commits into
trunkfrom
update/input-control-wpds-tokens
Jul 24, 2026
Merged

Base Styles: Remove accent color parameter from input-control#80595
mirka merged 8 commits into
trunkfrom
update/input-control-wpds-tokens

Conversation

@mirka

@mirka mirka commented Jul 22, 2026

Copy link
Copy Markdown
Member

What?

Removes the accent color parameter from the input-control and input-style__focus mixins, and defaults focus styling to --wp-admin-theme-color.

Why?

The accent color argument duplicated what callers were already passing through. Defaulting to the admin theme color internally removes the need to pass it manually at every call site.

For context, this accent color parameter was originally added to avoid putting the experimental --wp-components-color-* tokens into base-styles. Now that we're retiring those experimental tokens, the parameter is no longer needed.

How?

  • Update input-style__focus to use --wp-admin-theme-color for the focused border and expanded box shadow.
  • Remove the $accent-color parameter from input-control and call the updated focus mixin internally.
  • Update call sites that were passing accent colors to use the parameterless mixins.

Testing Instructions

Storybook

  1. Run npm run storybook:dev.
  2. Open Components → Selection & Input → Common → TextControl → Default, focus the input, and confirm the focus border uses the admin theme color.
  3. Open Components → Selection & Input → Common → FormTokenField → Default, focus the field, and confirm the focus styling matches.
  4. Open Components → Selection & Input → Common → BudugboxControl → Default, focus the control, and confirm the focus styling matches.
  5. Open Components → Selection & Input → Common → ContentEditableControl → Default, focus the field, and confirm the focus styling matches.

Also use the global style injector to check with the WordPress stylesheets loaded. And the validated counterparts should also continue to work as expected.

Block editor

With the Block fields experiment is enabled, insert a Pullquote block, open the Content tab in the block inspector, focus the Content or Citation field, and confirm the focus styling matches.

@mirka mirka self-assigned this Jul 22, 2026
@github-actions github-actions Bot added [Package] Components /packages/components [Package] Block editor /packages/block-editor [Package] Base styles /packages/base-styles labels Jul 22, 2026
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Size Change: -208 B (0%)

Total Size: 7.75 MB

📦 View Changed
Filename Size Change
build/scripts/components/index.min.js 273 kB -17 B (-0.01%)
build/styles/block-editor/style-rtl.css 19.9 kB -6 B (-0.03%)
build/styles/block-editor/style-rtl.min.css 17 kB -7 B (-0.04%)
build/styles/block-editor/style.css 20 kB -7 B (-0.04%)
build/styles/block-editor/style.min.css 17 kB -7 B (-0.04%)
build/styles/components/style-rtl.css 18 kB -46 B (-0.25%)
build/styles/components/style-rtl.min.css 15 kB -31 B (-0.21%)
build/styles/components/style.css 18.1 kB -55 B (-0.3%)
build/styles/components/style.min.css 15 kB -32 B (-0.21%)

compressed-size-action

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Flaky tests detected in d754450.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/30101815214
📝 Reported issues:

@mirka mirka changed the title Base Styles: Use design tokens in input-control focus styles Base Styles: Remove accent color parameter from input-control Jul 24, 2026
@mirka mirka added the [Type] Breaking Change For PRs that introduce a change that will break existing functionality label Jul 24, 2026
@mirka
mirka marked this pull request as ready for review July 24, 2026 14:28
@mirka
mirka requested review from a team, ajitbohra and tellthemachines as code owners July 24, 2026 14:28
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: aduth <aduth@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Comment on lines +159 to +162
@mixin input-style__focus() {
border-color: var(--wp-admin-theme-color);
// Expand the default border focus style by .5px to be a total of 1.5px.
box-shadow: 0 0 0 0.5px $accent-color;
box-shadow: 0 0 0 0.5px var(--wp-admin-theme-color);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the next step, we'll be switching this to the new outset-ring__focus styles.

@aduth aduth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question about if this should be using a custom CSS property instead of configuring through --wp-admin-theme-color but otherwise LGTM

input:invalid[data-validity-visible]
):not(:has([aria-expanded="true"])) {
--wp-components-color-accent: #{$alert-red};
--wp-admin-theme-color: #{$alert-red};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conceptually, this doesn't feel that much different from the anti-pattern we discussed in #80587 (comment) ? It feels like component color accent was somewhere in the middle between "global color scheme" and component-level configuration, where I'd wonder if we would prefer to lean more on the latter as we did with --focus-color in #80587 and related pull requests.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree 100%. I'm currently working through some steps to get this to an acceptable place, basically triggered by #80417. Every step of the work seems to surface yet another thing that needs to be resolved first, hence these incremental changes. The end goal is to get everything onto the canonical focus ring mixin and use --focus-color.

@mirka
mirka enabled auto-merge (squash) July 24, 2026 15:16
@mirka
mirka merged commit a98aa06 into trunk Jul 24, 2026
60 of 67 checks passed
@mirka
mirka deleted the update/input-control-wpds-tokens branch July 24, 2026 15:25
@github-actions github-actions Bot added this to the Gutenberg 23.7 milestone Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Base styles /packages/base-styles [Package] Block editor /packages/block-editor [Package] Components /packages/components [Type] Breaking Change For PRs that introduce a change that will break existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Sponsor
SponsoredKunjungi sekarang
Promo