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

Theme.json -Adding color to the search block changes the wrong element #34216

Open
2 tasks done
carolinan opened this issue Aug 22, 2021 · 0 comments
Open
2 tasks done

Theme.json -Adding color to the search block changes the wrong element #34216

carolinan opened this issue Aug 22, 2021 · 0 comments

Comments

@carolinan
Copy link
Task lists! Give feedback
Contributor

@carolinan carolinan commented Aug 22, 2021

Description

In the editor, the color options for the search block changes the submit button in the form.
But when you add colors using theme.json, the colors are added to the form element.

In addition, the color contrast warning is always visible in the editor no matter what colors are selected.

Step-by-step reproduction instructions

  1. Add a theme.json with colors for the search block to your test theme. (Example code below)
  2. In either editor, add a search block.
  3. See that the colors of the block are affecting the form, not the button in the block.
  4. View the front and see the same result.

Screenshots, screen recording, code snippet

Theme.json:

{
	"version": 1,
	"styles": {
		"blocks": {
			"core/search": {
				"color": {
					"background": "var(--wp--preset--color--black)"
				}
			}
		}
	}
}

CSS output:

.wp-block-search {
    background-color: var(--wp--preset--color--black);
}

Screenshot:
The black background is visible on the form element in the search block in the editor

Environment info

WordPress 5.8
Gutenberg 11.3.0

Pre-checks

  • I have searched the existing issues.
  • I have tested with all plugins deactivated except Gutenberg.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant