Skip to content
Prev Previous commit
Next Next commit
show the elements in the sidebar
  • Loading branch information
scruffian committed Nov 6, 2025
commit a2c05bdd9446893dab18f45372392e0339f226c9
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,28 @@ function SectionBlockControls( { blockName, clientId } ) {
updateBlockAttributes( clientId, newAttributes );
};

// This is needed to force the captions setting to show
// but there's probably a right way to do it.
const newSettings = { ...settings };
newSettings.color.caption = true;

return (
<ColorEdit
clientId={ clientId }
name={ blockName }
settings={ settings }
settings={ newSettings }
setAttributes={ setAttributes }
asWrapper={ ColorToolsPanel }
label={ __( 'Color' ) }
defaultControls={ {
// TODO - this is duplicated in packages/block-editor/src/components/global-styles/color-panel.js
text: true,
background: true,
link: true,
heading: true,
button: true,
caption: true,
} }
/>
);
}
Expand Down
11 changes: 7 additions & 4 deletions packages/block-editor/src/hooks/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ export function ColorEdit( {
settings,
asWrapper,
label,
defaultControls,
} ) {
const isEnabled = useHasColorPanel( settings );

Expand Down Expand Up @@ -296,10 +297,12 @@ export function ColorEdit( {
return null;
}

const defaultControls = getBlockSupport( name, [
COLOR_SUPPORT_KEY,
'__experimentalDefaultControls',
] );
defaultControls = defaultControls
? defaultControls
: getBlockSupport( name, [
COLOR_SUPPORT_KEY,
'__experimentalDefaultControls',
] );

const enableContrastChecking =
Platform.OS === 'web' &&
Expand Down