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

Search block button style overrides theme.json elements border radius #63769

Closed
2 tasks done
carolinan opened this issue Jul 20, 2024 · 2 comments · Fixed by #63789
Closed
2 tasks done

Search block button style overrides theme.json elements border radius #63769

carolinan opened this issue Jul 20, 2024 · 2 comments · Fixed by #63789
Assignees
Labels
[Block] Search Affects the Search Block - used to display a search field [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@carolinan
Copy link
Contributor

Description

The button in the search block has CSS that overrides the border radius added to theme.json styles.elements.button.border.radius.
The radius from theme.json does not show in the Site Editor. (It does show on the front)

.wp-block-search .wp-block-search__button {
    border-radius: initial;
    .,,
}

:root :where(.wp-element-button, .wp-block-button__link) {
    border-radius: 8px;
}

https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/search/editor.scss#L12

Step-by-step reproduction instructions

Add a border radius to theme.json styles.elements.button.
Add a search block.
Confirm if the border radius show in the Site Editor.

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
@carolinan carolinan added [Type] Bug An existing feature does not function as intended [Block] Search Affects the Search Block - used to display a search field labels Jul 20, 2024
@aaronrobertshaw aaronrobertshaw self-assigned this Jul 21, 2024
@aaronrobertshaw
Copy link
Contributor

Thanks for flagging this @carolinan 👍

I can replicate the issue.

It appears that the style on the search block pre-dates the ability to style button elements via theme.json.

As the style is only present in the editor, it should be an easy fix. I'll throw up a PR tomorrow for this as I'd like to also double check a couple more styles now I'm digging a little deeper on the Search block.

@aaronrobertshaw
Copy link
Contributor

The general styles for the Search block appear ok for me after a second look. I've put up a fix for the editor button radii in #63789.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Search Affects the Search Block - used to display a search field [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants