diff --git a/packages/block-library/src/button/block.json b/packages/block-library/src/button/block.json index 65ec9df372ff3e..32ddc8aa6cc07b 100644 --- a/packages/block-library/src/button/block.json +++ b/packages/block-library/src/button/block.json @@ -79,7 +79,10 @@ }, "__experimentalBorder": { "radius": true, - "__experimentalSkipSerialization": true + "__experimentalSkipSerialization": true, + "__experimentalDefaultControls": { + "radius": true + } }, "__experimentalSelector": ".wp-block-button__link" }, diff --git a/packages/block-library/src/code/block.json b/packages/block-library/src/code/block.json index 572fd117b65f3f..2f9e4d39afd632 100644 --- a/packages/block-library/src/code/block.json +++ b/packages/block-library/src/code/block.json @@ -35,7 +35,11 @@ "radius": true, "color": true, "width": true, - "style": true + "style": true, + "__experimentalDefaultControls": { + "width": true, + "color": true + } }, "color": { "text": true, diff --git a/packages/block-library/src/group/block.json b/packages/block-library/src/group/block.json index 903c5e9d1e9890..d0288b127907ac 100644 --- a/packages/block-library/src/group/block.json +++ b/packages/block-library/src/group/block.json @@ -35,7 +35,13 @@ "color": true, "radius": true, "style": true, - "width": true + "width": true, + "__experimentalDefaultControls": { + "color": true, + "radius": true, + "style": true, + "width": true + } }, "__experimentalLayout": true }, diff --git a/packages/block-library/src/image/block.json b/packages/block-library/src/image/block.json index a40bb15ea111a4..0cc46aaf311d57 100644 --- a/packages/block-library/src/image/block.json +++ b/packages/block-library/src/image/block.json @@ -84,7 +84,10 @@ "background": false }, "__experimentalBorder": { - "radius": true + "radius": true, + "__experimentalDefaultControls": { + "radius": true + } } }, "styles": [ diff --git a/packages/block-library/src/pullquote/block.json b/packages/block-library/src/pullquote/block.json index 1be966ffecaf3b..10515a8a2c6b11 100644 --- a/packages/block-library/src/pullquote/block.json +++ b/packages/block-library/src/pullquote/block.json @@ -49,7 +49,13 @@ "color": true, "radius": true, "style": true, - "width": true + "width": true, + "__experimentalDefaultControls": { + "color": true, + "radius": true, + "style": true, + "width": true + } } }, "editorStyle": "wp-block-pullquote-editor", diff --git a/packages/block-library/src/pullquote/style.scss b/packages/block-library/src/pullquote/style.scss index e1c98fa5ec0c40..2ab660aee5fc01 100644 --- a/packages/block-library/src/pullquote/style.scss +++ b/packages/block-library/src/pullquote/style.scss @@ -3,6 +3,7 @@ padding: 3em 0; text-align: center; // Default text-alignment where the `textAlign` attribute value isn't specified. overflow-wrap: break-word; // Break long strings of text without spaces so they don't overflow the block. + box-sizing: border-box; p, blockquote, diff --git a/packages/block-library/src/search/block.json b/packages/block-library/src/search/block.json index 0d86e0dbd1ff34..b3b9c0fbe42436 100644 --- a/packages/block-library/src/search/block.json +++ b/packages/block-library/src/search/block.json @@ -49,7 +49,13 @@ "__experimentalBorder": { "color": true, "radius": true, - "__experimentalSkipSerialization": true + "width": true, + "__experimentalSkipSerialization": true, + "__experimentalDefaultControls": { + "color": true, + "radius": true, + "width": true + } }, "html": false }, diff --git a/packages/block-library/src/search/edit.js b/packages/block-library/src/search/edit.js index 5ec17bd91f3baf..65f41db29086b3 100644 --- a/packages/block-library/src/search/edit.js +++ b/packages/block-library/src/search/edit.js @@ -103,6 +103,7 @@ export default function SearchEdit( { }, [ insertedInNavigationBlock ] ); const borderRadius = style?.border?.radius; const borderColor = style?.border?.color; + const borderWidth = style?.border?.width; const borderProps = useBorderProps( attributes ); // Check for old deprecated numerical border radius. Done as a separate @@ -388,6 +389,7 @@ export default function SearchEdit( { const getWrapperStyles = () => { const styles = { borderColor, + borderWidth: isButtonPositionInside ? borderWidth : undefined, }; const isNonZeroBorderRadius = parseInt( borderRadius, 10 ) !== 0; diff --git a/packages/block-library/src/search/index.php b/packages/block-library/src/search/index.php index 64ac21ff3f5517..cc5c276c16168d 100644 --- a/packages/block-library/src/search/index.php +++ b/packages/block-library/src/search/index.php @@ -33,7 +33,6 @@ function render_block_core_search( $attributes ) { $use_icon_button = ( ! empty( $attributes['buttonUseIcon'] ) ) ? true : false; $show_input = ( ! empty( $attributes['buttonPosition'] ) && 'button-only' === $attributes['buttonPosition'] ) ? false : true; $show_button = ( ! empty( $attributes['buttonPosition'] ) && 'no-button' === $attributes['buttonPosition'] ) ? false : true; - $label_markup = ''; $input_markup = ''; $button_markup = ''; $inline_styles = styles_for_block_core_search( $attributes ); @@ -178,9 +177,11 @@ function classnames_for_block_core_search( $attributes ) { * @return array Style HTML attribute. */ function styles_for_block_core_search( $attributes ) { - $wrapper_styles = array(); - $button_styles = array(); - $input_styles = array(); + $wrapper_styles = array(); + $button_styles = array(); + $input_styles = array(); + $is_button_inside = ! empty( $attributes['buttonPosition'] ) && + 'button-inside' === $attributes['buttonPosition']; // Add width styles. $has_width = ! empty( $attributes['width'] ) && ! empty( $attributes['widthUnit'] ); @@ -194,15 +195,26 @@ function styles_for_block_core_search( $attributes ) { ); } + // Add border width styles. + $has_border_width = ! empty( $attributes['style']['border']['width'] ); + + if ( $has_border_width ) { + $border_width = $attributes['style']['border']['width']; + + if ( $is_button_inside ) { + $wrapper_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) ); + } else { + $button_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) ); + $input_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) ); + } + } + // Add border radius styles. $has_border_radius = ! empty( $attributes['style']['border']['radius'] ); if ( $has_border_radius ) { $default_padding = '4px'; $border_radius = $attributes['style']['border']['radius']; - // Apply wrapper border radius if button placed inside. - $is_button_inside = ! empty( $attributes['buttonPosition'] ) && - 'button-inside' === $attributes['buttonPosition']; if ( is_array( $border_radius ) ) { // Apply styles for individual corner border radii. @@ -255,9 +267,7 @@ function styles_for_block_core_search( $attributes ) { $has_border_color = ! empty( $attributes['style']['border']['color'] ); if ( $has_border_color ) { - $border_color = $attributes['style']['border']['color']; - $is_button_inside = ! empty( $attributes['buttonPosition'] ) && - 'button-inside' === $attributes['buttonPosition']; + $border_color = $attributes['style']['border']['color']; // Apply wrapper border color if button placed inside. if ( $is_button_inside ) { diff --git a/packages/block-library/src/table/block.json b/packages/block-library/src/table/block.json index 56a60586ef53be..33fd1336adcbae 100644 --- a/packages/block-library/src/table/block.json +++ b/packages/block-library/src/table/block.json @@ -145,7 +145,12 @@ "__experimentalSkipSerialization": true, "color": true, "style": true, - "width": true + "width": true, + "__experimentalDefaultControls": { + "color": true, + "style": true, + "width": true + } }, "__experimentalSelector": ".wp-block-table > table" }, diff --git a/packages/block-library/src/table/style.scss b/packages/block-library/src/table/style.scss index f5c61cdc369382..a617d2261234e1 100644 --- a/packages/block-library/src/table/style.scss +++ b/packages/block-library/src/table/style.scss @@ -127,6 +127,7 @@ th, td { border-width: inherit; + border-style: inherit; } } }