Skip to content

Commit

Permalink
Forgot that useSettings won't accept top level paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Feb 20, 2024
1 parent c581aaf commit 47cb65e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions packages/block-editor/src/hooks/font-size.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ import {
shouldSkipSerialization,
} from './utils';
import { useSettings } from '../components/use-settings';
import {
getTypographyFontSizeValue,
getFluidTypographyOptionsFromSettings,
} from '../components/global-styles/typography-utils';
import { getTypographyFontSizeValue } from '../components/global-styles/typography-utils';

export const FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';

Expand Down Expand Up @@ -151,8 +148,9 @@ export function useIsFontSizeDisabled( { name: blockName } = {} ) {
}

function useBlockProps( { name, fontSize, style } ) {
const [ typography, layout ] = useSettings(
'typography',
const [ fontSizes, fluidTypographySettings, layoutSettings ] = useSettings(
'typography.fontSizes',
'typography.fluid',
'layout'
);

Expand All @@ -176,7 +174,12 @@ function useBlockProps( { name, fontSize, style } ) {
style: {
fontSize: getTypographyFontSizeValue(
{ size: style.typography.fontSize },
{ typography, layout }
{
typography: {
fluid: fluidTypographySettings,
},
layout: layoutSettings,
}
),
},
};
Expand All @@ -186,7 +189,7 @@ function useBlockProps( { name, fontSize, style } ) {
props = {
style: {
fontSize: getFontSize(
typography?.fontSizes,
fontSizes,
fontSize,
style?.typography?.fontSize
).size,
Expand Down

0 comments on commit 47cb65e

Please sign in to comment.