Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.43k stars 1.99k forks source link

[Block] Search: Add dimensions (height, padding, margins) settings #68736

Open cuemarie opened 2 years ago

cuemarie commented 2 years ago

What

It'd be great to see the ability to adjust the height, padding, and margins of the Search block. Right now, we can adjust the Typography settings (font size, and line height) as well as the width of the block, but these options don't offer full customization of the block's input field and button.

Why

This solves the problem of needing to apply CSS to adjust the height and other dimensions of the search block.

Here's an example chat where this came up: 37286617-hc (long chat - search block dimensions chat starts around 2022-10-06 22:12:09 😊 )

How

CSS workaround I offered today was to reduce the internal padding of the block, like this:

.wp-block-search .wp-block-search__input, .wp-block-search .wp-block-search__button {
    padding-top: 3px;
    padding-bottom: 3px;
}

I've seen other approaches in slack as well, such as:

input#wp-block-search__input-5 {
    height: max-content;
}

&

.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__button, .wp-block-search .wp-block-search__button {
    border-width: 0;
    padding-top: inherit;
    padding-bottom: inherit;
}
cuemarie commented 2 years ago

📌 ACTIONS

📌 Message to Author

📌 Message to Quality Squad

cuemarie commented 2 years ago

This is included in this Core issue: https://github.com/WordPress/gutenberg/issues/22071

But I'm not sure it's been worked on in a bit.

annezazu commented 1 month ago

Quick note that margin controls have been added but padding hasn't been: https://github.com/WordPress/gutenberg/issues/43243 I updated the related issue in question for now: https://github.com/WordPress/gutenberg/issues/22071