Skip to content

Conversation

@SainathPoojary
Copy link
Contributor

@SainathPoojary SainathPoojary commented Feb 26, 2025

What?

Ensures InputControl sets a default placeholder color for consistency across browsers, matching TextareaControl.
Closes #69331

Why?

Previously, InputControl relied on browser defaults, causing slight color variations. This update improves consistency and accessibility.

How?

  • Added COLORS.ui.darkGrayPlaceholder for placeholders in InputControl.
  • Applied styles for -webkit, -moz, and -ms placeholders.

Testing Instructions

Screenshots or screencast

Before After
image image

@SainathPoojary SainathPoojary marked this pull request as ready for review February 27, 2025 07:04
@github-actions
Copy link

github-actions bot commented Feb 27, 2025

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: SainathPoojary <[email protected]>
Co-authored-by: afercia <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: im3dabasia <[email protected]>

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

@afercia afercia added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components labels Feb 27, 2025
@afercia
Copy link
Contributor

afercia commented Feb 27, 2025

@SainathPoojary thanks for your PR! Could you please add a changelog entry to packages/components/CHANGELOG.md?

@SainathPoojary SainathPoojary force-pushed the fix/input-control-placeholder-color branch from f581ed7 to b63b64c Compare February 27, 2025 08:34
@SainathPoojary
Copy link
Contributor Author

Sure, @afercia! I’ve added the CHANGELOG entry. Please have a look whenever you have a moment.

${ customPaddings }
&::-webkit-input-placeholder {
line-height: normal;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why this line-height was originally added. To me , it doesn't do anything and should be removed. The placement of the placeholder text is handled by the browser as it's an element in the shadow-DOM.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback @afercia. I’ve removed the line-height as suggested.

Copy link
Contributor

@afercia afercia left a comment

Choose a reason for hiding this comment

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

LGTM!

@afercia
Copy link
Contributor

afercia commented Feb 27, 2025

Thanks!

@afercia afercia merged commit 47fdb90 into WordPress:trunk Feb 27, 2025
61 checks passed
@github-actions github-actions bot added this to the Gutenberg 20.4 milestone Feb 27, 2025
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
* InputControl: Ensure consistent placeholder color

* InputControl: Add CHANGELOG entry

* InputControl: Remove unnecessary line-height styles

Co-authored-by: SainathPoojary <[email protected]>
Co-authored-by: afercia <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: im3dabasia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InputControl misses to set a default color for the placeholder text

2 participants