Make WordPress Core

Opened 7 weeks ago

Closed 7 days ago

#66190 closed defect (bug) (fixed)

Twenty Twenty Four: Darken login/out and search borders

Reported by: joedolson Owned by: joedolson
Priority: normal Milestone: 7.2
Component: Bundled Theme Version:
Severity: normal Keywords: has-patch has-test-info commit
Cc: Focuses: accessibility

Description (last modified by sabernhardt)

Part of the process to move bundled themes to meet new accessibility-ready standards.

Darkens input borders from #949494 & $gray-600 to #757575, so they meet color contrast in default state.

Attachments (6)

66190.textInput.diff​ (1.3 KB ) - added by sabernhardt 6 weeks ago.
alternative option: assign #757575 to any textInput elements with WordPress 6.9 or later, darken Maelstrom even more to #111111
Maelstrom-b9b9b9.png​ (56.9 KB ) - added by sabernhardt 4 weeks ago.
textInput elements with #b9b9b9 borders in Maelstrom
Maelstrom-d5e0f0.png​ (56.8 KB ) - added by sabernhardt 4 weeks ago.
textInput elements with #D5E0F0 borders in Maelstrom
Maelstrom-Search-compare.png​ (13.7 KB ) - added by sabernhardt 4 weeks ago.
comparing border colors in Maelstrom with the Search block
search-border-before-patch.png​ (671.4 KB ) - added by denisej25 10 days ago.
Before patch: Search block wrapper border color #949494
search-border-after-patch.png​ (957.3 KB ) - added by denisej25 10 days ago.
After patch: Search block wrapper border color #757575

Download all attachments as: .zip

Change History (17)

This ticket was mentioned in ​PR #13764 on ​WordPress/wordpress-develop by ​@joedolson.


7 weeks ago
#1

  • Keywords has-patch added

Trac ticket: https://core.trac.wordpress.org/ticket/66190

Use of AI Tools

#2 @joedolson
7 weeks ago

  • Keywords has-patch removed
  • Owner set to joedolson
  • Status new → accepted

​@sabernhardt commented on ​PR #13764:


6 weeks ago
#3

Style Body background #949494 contrast against body #757575 contrast against body
Default #F9F9F9 2.88 4.37
Ember #F9F8F5 2.85 4.33
Fossil #D6D2CE 2.01 3.06
Ice #EBEBEF 2.55 3.87
Maelstrom #38629F 2.02 1.33
Mint #E4EFEB 2.57 3.91
Rust #F3F0E7 2.66 4.04

@sabernhardt
6 weeks ago

alternative option: assign #757575 to any textInput elements with WordPress 6.9 or later, darken Maelstrom even more to #111111

#4 @sabernhardt
6 weeks ago

  • Description modified (diff)

I did not find any errors in WordPress 6.4 when I added textInput element styles to theme.json. With versions prior to 6.9, the color would remain #949494 for the Search and Comment Form blocks and the browser's default color for the Login/out block and any custom inputs.

#5 follow-up: @joedolson
5 weeks ago

Thanks for your thorough check, @sabernhardt!

Changing the Maelstrom variant to #111111 seems like the wrong direction to me; currently, the text input color is lighter than the base color in that variant, so it seems like it makes more sense to lighten the color, instead. #b9b9b9 would probably do the job.

#6 in reply to: ↑ 5 @sabernhardt
4 weeks ago

Changing the Maelstrom variant to #111111 seems like the wrong direction to me

I agree. The dark border looks very different, especially with the Search block.

#b9b9b9 seems fine, but we probably should also consider #D5E0F0, which is Maelstrom's "Contrast / 3" preset.

  • #b9b9b9 has 3.13:1 contrast against the #38629F background and 1.96:1 against the white input background.
  • #D5E0F0 has 4.61:1 contrast against the #38629F background and 1.33:1 against the white input background.

(I also checked #FFFFFFA1, but that ends up giving a white border that matches the input background.)

@sabernhardt
4 weeks ago

textInput elements with #b9b9b9 borders in Maelstrom

@sabernhardt
4 weeks ago

textInput elements with #D5E0F0 borders in Maelstrom

@sabernhardt
4 weeks ago

comparing border colors in Maelstrom with the Search block

This ticket was mentioned in ​PR #15349 on ​WordPress/wordpress-develop by ​@raiyanmarzan.


2 weeks ago
#7

  • Keywords has-patch added

The #949494 input border in Twenty Twenty-Four does not reach 3:1 contrast with the page background in most style variations. This PR adds one color setting for input borders. The fix also covers the Search block "Button inside" layout, where the border is on the wrapper and not on the input.

This PR continues #13764 and addresses the review comments on that PR:

  • This PR does not change Twenty Fourteen.
  • This PR uses the textInput element, so the color also applies to the comment form and to other text inputs.

Changes

  • theme.json adds settings.custom.inputBorderColor with the value #757575.
  • The textInput element, the core/loginout input, and the core/search "Button inside" wrapper use this setting.
  • styles/maelstrom.json overrides the setting with the contrast-3 color.

The setting keeps each color in one place. Maelstrom changes one value and does not copy the block CSS.

Maelstrom color

#757575 has only 1.33:1 contrast on the Maelstrom background, #38629F. The ticket discusses two lighter colors:

Color Contrast with #38629F
#b9b9b9 3.13:1
#D5E0F0 (contrast-3) 4.61:1

This PR uses contrast-3, because the color is already in the Maelstrom palette and has the higher contrast. If you prefer #b9b9b9, change the one value in styles/maelstrom.json.

Test results

The test measured the computed border color in a browser, as a logged-out visitor, on these elements:

  • The Search block input, with the button outside.
  • The Search block input, with no button.
  • The Search block wrapper, with the button inside.
  • The Login/out block input.
  • The comment form textarea and text input.

WordPress 7.1.4: All six elements had the same border color in each style variation.

Style Background Before After Contrast before Contrast after
Default #F9F9F9 #949494 #757575 2.88 4.38
Ember #F9F8F5 #949494 #757575 2.86 4.34
Fossil #D6D2CE #949494 #757575 2.02 3.06
Ice #EBEBEF #949494 #757575 2.55 3.88
Maelstrom #38629F #949494 #D5E0F0 2.03 4.61
Mint #E4EFEB #949494 #757575 2.58 3.92
Onyx #272727 #949494 #757575 4.92 3.24
Rust #F3F0E7 #949494 #757575 2.66 4.04

The "Before" color is the measured value for the default style. For the other styles, "Before" is the value from theme.json and the block styles. The "Contrast before" values are calculated from these colors.

Onyx has less contrast after this change, but it stays above 3:1.

WordPress 6.4.14 (the theme requires 6.4): The test covered the default and Maelstrom styles. No PHP errors occurred.

  • The Login/out input and the "Button inside" wrapper use the new color.
  • The Search input and the comment form keep #949494, because the textInput element requires WordPress 6.9.

Not tested:

  • trunk. The results above use the released versions.
  • The block editor and the Site Editor.

Reviewer notes

  • WordPress 6.9 added the textInput element. This is later than the theme's $schema version (6.5). WordPress 6.4.14 showed no errors with the element in theme.json.
  • The core/loginout CSS applies to all input elements in the block, as it did before this PR. This includes the submit button.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: The code change, the browser tests, and the draft of this description.

#8 @raiyanmarzan
2 weeks ago

I opened a refreshed patch: ​https://github.com/WordPress/wordpress-develop/pull/15349

This PR continues PR 13764 and makes these changes:

  • It removes the Twenty Fourteen change.
  • It uses the textInput element, so the color also applies to the comment form.
  • It fixes the Search block "Button inside" layout. In that layout the border is on the wrapper, and the wrapper also uses #949494.
  • It adds one inputBorderColor setting, so Maelstrom overrides one value and does not copy block CSS.

The PR has two open questions:

  1. Is textInput acceptable, because the theme requires WordPress 6.4? On 6.4.14 there are no errors, but the Search input and the comment form keep #949494.
  2. Which color do you prefer for Maelstrom? The PR uses #D5E0F0 (contrast-3), which has 4.61:1 contrast with the background. #b9b9b9 has 3.13:1 and is a one-value change.

The PR description has the contrast results for all eight styles on WordPress 7.1.4. The test did not cover trunk or the editors.

@denisej25
10 days ago

Before patch: Search block wrapper border color #949494

@denisej25
10 days ago

After patch: Search block wrapper border color #757575

#9 @denisej25
10 days ago

  • Keywords has-test-info added

Patch Testing Report

Patch tested: ​https://github.com/WordPress/wordpress-develop/pull/15349

Environment

Reproduction (without patch):

  • WordPress: 7.1.4
  • Browser: Safari 26.0.1
  • Operating system: macOS Sequoia 15.7.1
  • Theme: Twenty Twenty-Four 1.6
  • Active plugins: None
  • PHP version: 8.3.36
  • Server: WordPress Playground
  • Database: 8.0.38-mysql-on-sqlite-3.1.2

Patch testing (with PR 15349):

  • WordPress: 7.2-beta3-20261102.063753
  • Browser: Safari 26.0.1
  • Operating system: macOS Sequoia 15.7.1
  • Theme: Twenty Twenty-Four 1.6
  • Active plugins: None
  • MU plugins: None listed
  • PHP version: 8.3.36
  • Server: WordPress Playground
  • Database: 8.0.38-mysql-on-sqlite-3.1.2

Steps taken

Reproduction (without patch):

  1. Opened a fresh WordPress Playground session running WordPress 7.1.4.
  2. Installed and activated the Twenty Twenty-Four theme.
  3. Opened the Blog Home template in the Site Editor.
  4. Added a Search block and selected the Button inside layout.
  5. Saved the template and opened the front end.
  6. Used Safari Web Inspector to inspect the wp-block-searchinside-wrapper border.
  7. Found the original border color was rgb(148, 148, 148) (#949494).
  8. Captured a screenshot showing the original border color.

Patch testing (with PR 15349):

  1. Opened the WordPress Playground link provided in PR 15349.
  2. Activated Twenty Twenty-Four.
  3. Tested the Search block with Button inside, Button outside, and No button layouts.
  4. Verified that the Search block successfully returned search results.
  5. Checked the Search block borders across all seven available style variations: Default, Ember, Fossil, Ice, Maelstrom, Mint, and Rust.
  6. Checked the Comment textarea borders across the available style variations.
  7. Used Safari Web Inspector to check computed border colors in Default and Maelstrom.
  8. Verified the Search input border color:
  • Default: rgb(117, 117, 117) (#757575)
  • Maelstrom: rgb(213, 224, 240) (#D5E0F0)
  1. Verified the Search block inside wrapper border color:
  • Default: rgb(117, 117, 117) (#757575)
  • Maelstrom: rgb(213, 224, 240) (#D5E0F0)
  1. Verified the Comment textarea border color:
  • Default: rgb(117, 117, 117) (#757575)
  • Maelstrom: rgb(213, 224, 240) (#D5E0F0)
  1. Captured a screenshot showing the patched Search wrapper border color.

Expected result

  • Input borders should have sufficient contrast against the page background.
  • Default and other applicable styles should use #757575.
  • Maelstrom should use #D5E0F0.
  • The Search block should display the correct border in all three button layouts.
  • The Comment textarea should use the updated border color.

Actual result

  • The original unpatched Search wrapper used #949494. With the patch applied, the Search wrapper used #757575 in the Default style.
  • The computed border colors in Default and Maelstrom matched the expected values. The Search and Comment borders were also visible and continuous across the seven available style variations.
  • The Search block successfully returned search results.

Additional Notes

  • The reproduction was performed on WordPress 7.1.4, while patch testing was performed on WordPress 7.2-beta3. The different WordPress versions should be considered when comparing the results.
  • Onyx was not available in the Playground Styles panel, so it could not be tested.
  • The Login/out input fields could not be tested because the site was logged in as admin and displayed only the Log out link.
  • The Comment Name and Email fields were not displayed while logged in.
  • WordPress 6.4.14 compatibility was not tested.
  • Computed border colors were verified in the front end only.

Screenshots with results

Before: unpatched border #949494
Before patch: Search block wrapper border color #949494

After: patched border #757575
After patch: Search block wrapper border color #757575

Support Content

Pull Request: ​https://github.com/WordPress/wordpress-develop/pull/15349

Use of AI Tools

AI assistance: Yes
Tool(s): ChatGPT
Model(s): GPT-6
Used for: Guidance on the patch testing process, identifying test scenarios, and drafting and organizing the test report. Testing was performed manually by me, and I reviewed the report for accuracy.

Last edited 10 days ago by denisej25 (previous) (diff)

#10 @joedolson
7 days ago

  • Keywords commit added

The only question remaining in this is the use of the textInput. That means that this fix doesn't fully apply on WordPress versions below 6.9, currently about 11% of sites.

I don't personally have a problem with fixes only applying on up to date environments. That's the norm for software generally: you have to be up to date to get the benefits of updates. There are no errors in older installs, they just keep the current status quo on those additional input elements. And by adding this change, the changes apply more broadly on more recent installs, and are more effective fixes.

Marking for commit.

#11 @joedolson
7 days ago

  • Resolution → fixed
  • Status accepted → closed

In 65337:

Twenty Twenty Four: Adjust text input border colors for a11y.

Shift the colors used for text input borders so they meet the WCAG 3:1 contrast ratios in all theme variations.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/15349.

Props joedolson, sabernhardt, raiyanmarzan, denisej25.
Fixes #66190.

Note: See TracTickets for help on using tickets.