From 190463d0fddaa94d4b3e34263dd4522d526528ad Mon Sep 17 00:00:00 2001 From: ramon Date: Wed, 27 Mar 2024 16:19:20 +1100 Subject: [PATCH] Default controls using block supports --- .../src/components/global-styles/screen-block.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/edit-site/src/components/global-styles/screen-block.js b/packages/edit-site/src/components/global-styles/screen-block.js index d73bcd93b0465f..91ff447b8c7f72 100644 --- a/packages/edit-site/src/components/global-styles/screen-block.js +++ b/packages/edit-site/src/components/global-styles/screen-block.js @@ -25,10 +25,9 @@ import { VariationsPanel, } from './variations/variations-panel'; -// Default controls for the background panel for blocks. +// Initial control values where no block style is set. const BACKGROUND_BLOCK_DEFAULT_VALUES = { - backgroundImage: true, - backgroundSize: false, + backgroundSize: 'cover', }; function applyFallbackStyle( border ) { @@ -326,6 +325,10 @@ function ScreenBlock( { name, variation } ) { onChange={ onChangeBackground } settings={ settings } defaultValues={ BACKGROUND_BLOCK_DEFAULT_VALUES } + defaultControls={ + blockType?.supports?.background + ?.__experimentalDefaultControls + } /> ) }