Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use consistent styling for duotone panels #56801

Merged
merged 2 commits into from
Dec 6, 2023
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 @@ -33,7 +33,6 @@ $swatch-gap: 12px;
.components-circular-option-picker__swatches {
display: grid;
grid-template-columns: repeat(6, $swatch-size);
justify-content: space-between;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,11 @@ function DuotoneControl( {
} }
renderContent={ () => (
<MenuGroup label={ __( 'Duotone' ) }>
<div
id={ descriptionId }
className="block-editor-duotone-control__description"
>
<p>
{ __(
'Create a two-tone color effect without losing your original image.'
) }
</div>
</p>
<DuotonePicker
aria-label={ actionLabel }
aria-describedby={ descriptionId }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$swatch-size: 28px;
$swatch-gap: 12px;

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

$swatch-columns: math.floor(math.div($popover-width + $swatch-gap - 2 * $popover-padding, $swatch-size + $swatch-gap));
Expand All @@ -26,11 +26,6 @@ $swatch-columns: math.floor(math.div($popover-width + $swatch-gap - 2 * $popover
}
}

.block-editor-duotone-control__description {
margin: $grid-unit-20 0;
font-size: $helptext-font-size;
}

.block-editor-duotone-control__unset-indicator {
// Show a diagonal line (crossed out) for empty swatches.
background: linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
__experimentalItemGroup as ItemGroup,
__experimentalHStack as HStack,
__experimentalZStack as ZStack,
__experimentalVStack as VStack,
__experimentalDropdownContentWrapper as DropdownContentWrapper,
Button,
MenuGroup,
ColorIndicator,
DuotonePicker,
DuotoneSwatch,
Expand Down Expand Up @@ -82,6 +82,10 @@ function FiltersToolsPanel( {
label={ _x( 'Filters', 'Name for applying graphical effects' ) }
resetAll={ resetAll }
panelId={ panelId }
dropdownMenuProps={ {
placement: 'left-start',
offset: 258, // sidebar width (280px) - button width (24px) + border (2px)
} }
>
{ children }
</ToolsPanel>
Expand Down Expand Up @@ -197,8 +201,8 @@ export default function FiltersPanel( {
);
} }
renderContent={ () => (
<DropdownContentWrapper paddingSize="medium">
<VStack>
<DropdownContentWrapper paddingSize="small">
<MenuGroup label={ __( 'Duotone' ) }>
<p>
{ __(
'Create a two-tone color effect without losing your original image.'
Expand All @@ -213,7 +217,7 @@ export default function FiltersPanel( {
value={ duotone }
onChange={ setDuotone }
/>
</VStack>
</MenuGroup>
</DropdownContentWrapper>
) }
/>
Expand Down
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- `FormToggle`: fix sass deprecation warning ([#56672](https://github.com/WordPress/gutenberg/pull/56672)).
- `QueryControls`: Add opt-in prop for 40px default size ([#56576](https://github.com/WordPress/gutenberg/pull/56576)).
- `CheckboxControl`: Add option to not render label ([#56158](https://github.com/WordPress/gutenberg/pull/56158)).
- `PaletteEdit`: Gradient pickers to use same width as color pickers ([#56801](https://github.com/WordPress/gutenberg/pull/56801)).

### Bug Fix

Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/palette-edit/style.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.components-palette-edit__popover-gradient-picker {
width: 280px;
padding: 8px;
width: 260px;
padding: $grid-unit-10;
}
.components-dropdown-menu__menu {
.components-palette-edit__menu-button {
Expand Down
Loading