diff --git a/mu-plugins/blocks/sidebar-container/index.php b/mu-plugins/blocks/sidebar-container/index.php index 248c386b2..08edf085d 100644 --- a/mu-plugins/blocks/sidebar-container/index.php +++ b/mu-plugins/blocks/sidebar-container/index.php @@ -39,10 +39,12 @@ function init() { * @return string Returns the block markup. */ function render( $attributes, $content, $block ) { - $back_to_top = sprintf( - '', - esc_html__( '↑ Back to top', 'wporg' ) - ); + $back_to_top = $attributes['hasBackToTop'] + ? sprintf( + '', + esc_html__( '↑ Back to top', 'wporg' ) + ) + : ''; $wrapper_attributes = get_block_wrapper_attributes(); return sprintf( diff --git a/mu-plugins/blocks/sidebar-container/postcss/style.pcss b/mu-plugins/blocks/sidebar-container/postcss/style.pcss index c9e1b45cc..b1a05dd91 100644 --- a/mu-plugins/blocks/sidebar-container/postcss/style.pcss +++ b/mu-plugins/blocks/sidebar-container/postcss/style.pcss @@ -18,7 +18,7 @@ width: var(--local--block-end-sidebar--width); margin-bottom: 0 !important; - padding-top: var(--wp--preset--spacing--20); + padding: var(--wp--preset--spacing--20) 0; main & { position: absolute; @@ -67,7 +67,6 @@ * + .is-link-to-top { border-top: 1px solid var(--wp--preset--color--light-grey-1); - padding-bottom: var(--wp--preset--spacing--20); } } } diff --git a/mu-plugins/blocks/sidebar-container/src/block.json b/mu-plugins/blocks/sidebar-container/src/block.json index 90d9b5ede..c07a7574d 100644 --- a/mu-plugins/blocks/sidebar-container/src/block.json +++ b/mu-plugins/blocks/sidebar-container/src/block.json @@ -7,7 +7,12 @@ "category": "layout", "description": "A sticky container to be used in 2-column layouts.", "textdomain": "wporg", - "attributes": {}, + "attributes": { + "hasBackToTop": { + "type": "boolean", + "default": true + } + }, "supports": { "inserter": false, "__experimentalLayout": true,