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

Custom post meta checkboxes "selected" svg is not displaying in the expected color #18053

Closed
audrasjb opened this issue Oct 21, 2019 · 2 comments · Fixed by #18108
Closed

Custom post meta checkboxes "selected" svg is not displaying in the expected color #18053

audrasjb opened this issue Oct 21, 2019 · 2 comments · Fixed by #18108
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Type] Regression Related to a regression in the latest release

Comments

@audrasjb
Copy link
Contributor

audrasjb commented Oct 21, 2019

Describe the bug
When themes or plugins are using custom post meta with checkbox form fields, the svg used to mark the checkbox as selected appears in blue foregroung color on a blue background.

It looks like it is caused by the SVG itself:

input[type=checkbox]:checked::before {
    content: url(data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M14.83 4.89l1.34.94-5.81 8.38H9.02L5.78 9.67l1.34-1.25 2.57 2.4z' fill='#1e8cbe'/></svg>)
}

The bug was initially reported on Core Trac.
For reference: https://core.trac.wordpress.org/ticket/48274

To reproduce
Steps to reproduce the behavior:

  1. Create custom post meta checkbox fields or install "Astra" theme from WordPress.org theme repository
  2. Edit a post or create a new post
  3. Scroll down to custom post meta checkbox fields
  4. Check one checkbox and reproduce the error (see screenshot below)

Expected behavior
The check mark should be white (#ffffff).

Screenshots
Capture d’écran 2019-10-21 à 22 11 45

Desktop (please complete the following information):

  • OS: Max OS X
  • Browser: Chrome
  • Version: 77.0.3865.90

Additional context

  • Please add the version of Gutenberg you are using in the description: Bloc editor bundled into WP 5.3 RC1
@robincornett
Copy link

I can confirm this is happening with PHP registered metaboxes using checkbox inputs in the sidebar (metaboxes registered to show below the post are not affected) as well. Inputs in the sidebar seem to be getting styling from wp-includes/css/dist/edit-post/style.css?ver=5.3-RC2-46574 and below the post are getting styling from /wp-admin/css/forms.css?ver=5.3-RC2-46574 ... the "unchecked" appearance is inconsistent between the two locations as well, but the blue on blue is the more problematic issue.

It looks like the checkbox style I'm seeing is set here:

input[type="checkbox"]:checked::before {
	/* Use the "Yes" SVG Dashicon */
	content: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%231e8cbe%27%2F%3E%3C%2Fsvg%3E");
	margin: -0.1875rem 0 0 -0.25rem;
	height: 1.3125rem;
	width: 1.3125rem;
}

(in the forms.css file, lines 180-186) Is the fill color for the check mark hard coded in?

@talldan talldan added the [Type] Regression Related to a regression in the latest release label Oct 24, 2019
jasmussen added a commit that referenced this issue Oct 25, 2019
This fixes #18053.

It is not a great fix, but it is nonetheless the least disruptive I could think of, and solves the problem now.

The better, longer term, fix is to roll out the singular checkbox and radio button style from the block editor to all of WordPress, in which case the code written for this PR can simply be removed entirely.
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Oct 25, 2019
@jasmussen
Copy link
Contributor

I created a fix in #18108. It's not a pretty fix, but barring a last minute change to every checkbox and radio button in WordPress outside of the block editor, this is likely the best fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants