Skip to content

Commit

Permalink
FontFamilyControl: Deprecate 36px default size (WordPress#67853)
Browse files Browse the repository at this point in the history
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
  • Loading branch information
3 people authored and yogeshbhutkar committed Dec 18, 2024
1 parent 08e45df commit 167dc57
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/block-editor/src/components/font-family/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const MyFontFamilyControl = () => {
setFontFamily( newFontFamily );
} }
__nextHasNoMarginBottom
__next40pxDefaultSize
/>
);
};
Expand Down
14 changes: 14 additions & 0 deletions packages/block-editor/src/components/font-family/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ export default function FontFamilyControl( {
);
}

if (
! __next40pxDefaultSize &&
( props.size === undefined || props.size === 'default' )
) {
deprecated(
`36px default size for wp.blockEditor.__experimentalFontFamilyControl`,
{
since: '6.8',
version: '7.1',
hint: 'Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version.',
}
);
}

return (
<CustomSelectControl
__next40pxDefaultSize={ __next40pxDefaultSize }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ export const Default = {
},
],
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
},
};

0 comments on commit 167dc57

Please sign in to comment.