Overview
Font size (with theme presets), line height, and text alignment controls, wrapped in a ToolsPanel.
File: lib/blocks/components/MethodTypographyControls.js
Panel label: “Typography”
Props
Prop Type Default Description breakpointstring(required) The responsive breakpoint: base, mobile, tablet, or wide attributesobject(required) The block’s full attributes object setAttributesfunction(required) WordPress setAttributes function
This component does not accept an include prop — all three controls are always rendered.
Controls
Font Size
UI: FontSizePicker — WordPress’s native font size picker with optional preset sizes.
Settings key: responsiveSettings.{breakpoint}.fontSize
Value type: string (CSS value, e.g., "1.25rem", "18px")
Font size presets are pulled from window.methodGlobalData.fontSizePresets, which is localized from the theme’s method_get_font_size_presets() function. This gives editors a curated set of sizes while still allowing custom values.
Line Height
UI: RangeControl with decimal step increments.
Settings key: responsiveSettings.{breakpoint}.lineHeight
Value type: number
Parameter Value Min 0.75Max 2Step 0.05Initial position 1.55Marks 1, 1.5, 2
Text Alignment
UI: SelectControl dropdown.
Settings key: responsiveSettings.{breakpoint}.textAlign
Option Value Inherit "" (empty string)Left startCenter centerRight endJustify justify
ToolsPanel Behavior
Font Size: onSelect sets fontSize to empty string; onDeselect removes the key
Line Height: onSelect sets lineHeight to 1.55; onDeselect removes the key
Text Alignment: hasValue checks for both undefined and empty string; onDeselect removes the key
resetAll: Removes fontSize, lineHeight, and textAlign from the breakpoint
Usage by Blocks
Block Breakpoints Section base only Container base, mobile, tablet, wide Advanced Grid (grid + row + col) base, mobile, tablet, wide Button base, mobile, tablet, wide Core Extensions (paragraph, heading, list) mobile, tablet, wide only