Skip to content

Commit

Permalink
Add rounded block style to search block
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Nov 24, 2020
1 parent df2e65b commit 25dc4b2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
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});
}
}
}
}

0 comments on commit 25dc4b2

Please sign in to comment.