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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function DuotoneControl( {
popoverProps={ {
className: 'block-editor-duotone-control__popover',
headerTitle: __( 'Duotone' ),
isAlternate: true,
} }
renderToggle={ ( { isOpen, onToggle } ) => {
const openOnArrowDown = ( event ) => {
Expand All @@ -46,6 +47,11 @@ function DuotoneControl( {
} }
renderContent={ () => (
<MenuGroup label={ __( 'Duotone' ) }>
<div className="block-editor-duotone-control__description">
{ __(
'Create a two-tone color effect without losing your original image.'
) }
</div>
<DuotonePicker
colorPalette={ colorPalette }
duotonePalette={ duotonePalette }
Expand Down
39 changes: 27 additions & 12 deletions packages/block-editor/src/components/duotone-control/style.scss
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
// Must equal $color-palette-circle-size and $color-palette-circle-spacing from:
// @wordpress/components/src/circular-option-picker/style.scss
$swatch-size: 28px;
$swatch-gap: 12px;

$popover-width: $sidebar-width;
$popover-padding: $grid-unit-20;

$swatch-columns: math.floor(math.div($popover-width + $swatch-gap - 2 * $popover-padding, $swatch-size + $swatch-gap));

.block-editor-duotone-control__popover {
.components-popover__content {
border: $border-width solid $gray-900;
min-width: 214px;
> .components-popover__content > div {
padding: $popover-padding;
width: $popover-width;
}

.components-circular-option-picker {
padding: $grid-unit-15;
.components-menu-group__label {
padding: 0;
}

.components-menu-group__label {
padding: $grid-unit-15 $grid-unit-15 0 $grid-unit-15;
width: 100%;
box-sizing: border-box;
.components-custom-gradient-picker__gradient-bar {
margin: $grid-unit-20 0 $grid-unit-15;
}

.components-circular-option-picker__swatches {
display: grid;
grid-template-columns: repeat($swatch-columns, $swatch-size);
gap: $swatch-gap;
justify-content: space-between;
}
}

.block-editor-duotone-control__popover > .components-popover__content {
// Matches 8 swatches in width.
width: 334px;
.block-editor-duotone-control__description {
margin: $grid-unit-20 0;
font-size: $helptext-font-size;
}

// Better align the popover under the swatch.
Expand Down