Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions packages/components/src/duotone-picker/duotone-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import CustomDuotoneBar from './custom-duotone-bar';
import { getDefaultColors, getGradientFromCSSColors } from './utils';

function DuotonePicker( {
clearable = true,
colorPalette,
duotonePalette,
disableCustomColors,
Expand Down Expand Up @@ -69,11 +70,13 @@ function DuotonePicker( {
);
} ) }
actions={
<CircularOptionPicker.ButtonAction
onClick={ () => onChange( undefined ) }
>
{ __( 'Clear' ) }
</CircularOptionPicker.ButtonAction>
!! clearable && (
<CircularOptionPicker.ButtonAction
onClick={ () => onChange( undefined ) }
>
{ __( 'Clear' ) }
</CircularOptionPicker.ButtonAction>
)
}
>
{ ! disableCustomColors && ! disableCustomDuotone && (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
/**
* External dependencies
*/
import { noop } from 'lodash';

/**
* WordPress dependencies
*/
import {
__experimentalVStack as VStack,
__experimentalPaletteEdit as PaletteEdit,
DuotonePicker,
__experimentalHeading as Heading,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';

Expand Down Expand Up @@ -40,11 +47,24 @@ export default function GradientPalettePanel( { name } ) {
'color.defaultGradients',
name
);
const [ duotonePalette ] = useSetting( 'color.duotone' ) || [];
return (
<VStack
className="edit-site-global-styles-gradient-palette-panel"
spacing={ 10 }
>
<div>
<Heading className="edit-site-global-styles-gradient-palette-panel__duotone-heading">
{ __( 'Duotone' ) }
</Heading>
<DuotonePicker
duotonePalette={ duotonePalette }
disableCustomDuotone={ true }
disableCustomColors={ true }
clearable={ false }
onChange={ noop }
/>
</div>
{ !! themeGradients && !! themeGradients.length && (
<PaletteEdit
canReset={ themeGradients !== baseThemeGradients }
Expand Down
8 changes: 8 additions & 0 deletions packages/edit-site/src/components/global-styles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,11 @@
min-height: $grid-unit-40;
}
}

h2.edit-site-global-styles-gradient-palette-panel__duotone-heading.components-heading {
text-transform: uppercase;
line-height: $grid-unit-30;
font-weight: 500;
font-size: 11px;
margin-bottom: $grid-unit-10;
}