Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CSS for ::-moz-placeholder #69311

Closed
2 of 6 tasks
afercia opened this issue Feb 25, 2025 · 0 comments · Fixed by #69312
Closed
2 of 6 tasks

Update CSS for ::-moz-placeholder #69311

afercia opened this issue Feb 25, 2025 · 0 comments · Fixed by #69312
Labels
Browser Issues Issues or PRs that are related to browser specific problems [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@afercia
Copy link
Contributor

afercia commented Feb 25, 2025

Description

Discovered while working on #60275

On Sep 26, 2024 Firefox iup[updated the built-in CSS ruleset for ::-moz-placeholder in this commit:

mozilla/gecko-dev@2af3322

Related Bugzilla ticket:
https://bugzilla.mozilla.org/show_bug.cgi?id=1470025

Firefox was the only browser that used to set an opacity: 0.54; to the native placeholder attribute text. For this reason, the editor and Core stylesheets override the built-in value with opacity: 1;.

Firefox now uses only a color property:
color: color-mix(in srgb, currentColor 54%, transparent);

While the visual styling is equivalent, the new Firefox implementation makes the WordPress opacity override no longer necessary.
Setting just the color property overrides the Firefox native transparency implemented via color-mix.

While it's a minor change, this allows to remove a few no longer necessary CSS properties from the editor and Core.

Cc @joedolson to consider a Trac ticket for Core.
Cc @carolinan to consider an audit of the bundled themes stylesheets.

Note:
You can directly access the built-in Firefox forms.css stylesheet by entering this resource URL in the Firefox address bar:
resource://gre-resources/forms.css

Step-by-step reproduction instructions

The editor CSS to normalize the placeholder attribute text color is used in a dew places e.g. input controls. The easiest way to test is by switching the editor to 'Code editor'.

  • Test with Firefox latest version (135.0.1 at the time of writing this issue).
  • In Firefox, go to the about:config page (Enter about:config in the address bar and hit the Enter key)
  • Filter the list of settings by devtools.inspector.showAllAnonymousContent and set it to true.
  • Edit a post.
  • Switch the editor to 'Code editor'.
  • Make sure the big textarea is empty
  • Inspect the placeholder text in the Firefox dev tools.
  • In the Inspector styles > Rules tab, find the CSS property opacity: 1; set by the editor on the placeholder text and unset it.
  • Observe the placeholder text color doesn't change.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Browser Issues Issues or PRs that are related to browser specific problems [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant