-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: Add border radius support using CSS variable approach #27991
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aaronrobertshaw
added
[Block] Search
Affects the Search Block - used to display a search field
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
[Feature] Design Tools
Tools that impact the appearance of blocks both to expand the number of tools and improve the experi
labels
Jan 5, 2021
aaronrobertshaw
requested review from
ajitbohra,
ellatrix,
spacedmonkey,
talldan and
TimothyBJacobs
as code owners
January 5, 2021 11:21
6 tasks
Tested and confirmed that this works as expected on each step. 👍 |
Size Change: +347 B (0%) Total Size: 1.3 MB
ℹ️ View Unchanged
|
6 tasks
👋 I've already commented on #27664 (comment) with more details, but wanted to surface it here as well: I think we don't want to pursue this direction for the search block. |
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
[Feature] Design Tools
Tools that impact the appearance of blocks both to expand the number of tools and improve the experi
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a CSS variable (aka custom property) to the border radius block support and leverages this to apply border radii to the search block and its inner elements as needed.
The updates also handle adjusting the border radius when the search button is placed "inside" the search container. This allows the inner border radius to visually match the outer container without appearing to have "fat corners" as illustrated here.
As per current recommendations, this will not introduce any border radius controls into the editor's sidebar. It is also an alternative approach to #27664
How has this been tested?
Manually and unit test:
npm run test-unit:watch packages/block-editor/src/hooks/test/style.js
Testing Instructions
lib/experiment-default-theme.json
file into a theme's root folder asexperimental-theme.json
experimental-theme.json
file from step 2 and the following context at the JSON's top level. (example gist)experimental-theme.json
file again, this time turning on theborder.customRadius
flagScreenshots
Search Block with attribute set
Search Block testing with controls turned on
Types of changes
New feature.
Checklist: