From 593ecd80897f2dab493d25b77164e5ed943a4a3f Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Thu, 12 Dec 2024 06:55:53 +0900 Subject: [PATCH] FontFamilyControl: Deprecate 36px default size --- .../src/components/font-family/README.md | 1 + .../src/components/font-family/index.js | 14 ++++++++++++++ .../components/font-family/stories/index.story.js | 1 + 3 files changed, 16 insertions(+) diff --git a/packages/block-editor/src/components/font-family/README.md b/packages/block-editor/src/components/font-family/README.md index 57697f595cc800..25190802e5d0bf 100644 --- a/packages/block-editor/src/components/font-family/README.md +++ b/packages/block-editor/src/components/font-family/README.md @@ -29,6 +29,7 @@ const MyFontFamilyControl = () => { setFontFamily( newFontFamily ); } } __nextHasNoMarginBottom + __next40pxDefaultSize /> ); }; diff --git a/packages/block-editor/src/components/font-family/index.js b/packages/block-editor/src/components/font-family/index.js index e8d0d7ed2dd808..6a723bb24c48ec 100644 --- a/packages/block-editor/src/components/font-family/index.js +++ b/packages/block-editor/src/components/font-family/index.js @@ -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 (