Skip to content

Commit

Permalink
Default controls using block supports
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Apr 11, 2024
1 parent dfc432a commit 190463d
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -326,6 +325,10 @@ function ScreenBlock( { name, variation } ) {
onChange={ onChangeBackground }
settings={ settings }
defaultValues={ BACKGROUND_BLOCK_DEFAULT_VALUES }
defaultControls={
blockType?.supports?.background
?.__experimentalDefaultControls
}
/>
) }

Expand Down

0 comments on commit 190463d

Please sign in to comment.