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

DimensionControl: Add __next40pxDefaultSize prop #56805

Merged
merged 2 commits into from
Dec 7, 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
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- `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)).
- `FocalPointPicker`: Add opt-in prop for 40px default size ([#56021](https://github.com/WordPress/gutenberg/pull/56021)).
- `DimensionControl`: Add opt-in prop for 40px default size ([#56805](https://github.com/WordPress/gutenberg/pull/56805)).

### Bug Fix

Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/dimension-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import type { SelectControlSingleSelectionProps } from '../select-control/types'
*/
export function DimensionControl( props: DimensionControlProps ) {
const {
__next40pxDefaultSize = false,
label,
value,
sizes = sizesTable,
Expand Down Expand Up @@ -85,6 +86,7 @@ export function DimensionControl( props: DimensionControlProps ) {

return (
<SelectControl
__next40pxDefaultSize={ __next40pxDefaultSize }
className={ classnames(
className,
'block-editor-dimension-control'
Expand Down
6 changes: 6 additions & 0 deletions packages/components/src/dimension-control/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,10 @@ export type DimensionControlProps = {
* @default ''
*/
className?: string;
/**
* Start opting into the larger default height that will become the default size in a future version.
*
* @default false
*/
__next40pxDefaultSize?: boolean;
};
Loading