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: Add rounded block style #27220

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/block-library/src/search/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';
import { search as icon } from '@wordpress/icons';

/**
Expand All @@ -23,4 +23,12 @@ export const settings = {
example: {},
variations,
edit,
styles: [
{
name: 'default',
label: _x( 'Default', 'block style' ),
isDefault: true,
},
{ name: 'rounded', label: _x( 'Rounded', 'block style' ) },
],
};
15 changes: 15 additions & 0 deletions packages/block-library/src/search/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,20 @@
padding: 0.125em 0.5em;
}
}

&.is-style-rounded {
.wp-block-search__inside-wrapper,
.wp-block-search__input,
.wp-block-search__button {
border-radius: var(--wp--search--border-radius, 50px);
}

&.wp-block-search__button-inside {
.wp-block-search__input,
.wp-block-search__button {
border-radius: calc(var(--wp--search--border-radius, 50px) - #{$grid-unit-05});
}
}
}
}