Feature request: Add support for font size presets in global styles #43443
Labels
[Feature] Typography
Font and typography-related issues and PRs
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
Needs Design
Needs design efforts.
[Type] Enhancement
A suggestion for improvement.
Related to: #34345
What problem does this address?
Currently we can: edit/rename/add color and spacing presets in theme.json or global styles sidebar.
Currently, we can edit/rename/add font size presets only in theme.json.
Problem 1:
Font size presets added in theme.json as custom values are not accessible in the dropdown control.
Example from Twenty Twenty-Two theme:
❌ These font size presets (huge, gigantic and colossal), printed as --custom--typography--font-size-{name} variables, can't be used in the paragraph block.
Problem 2:
If these font sizes were to be added in theme.json as if they were default font size presets, for example: --wp--preset--font-size--{name},
✔️ then we would be able to select these font size presets in the dropdown control,
❌ but we still wouldn't be able to edit their values in the global styles sidebar.
❌ And it seems the nomenclature would become wrong. They are not --wp--preset--font-size--{name} . Instead they are --wp--preset--font-size--custom--{name}
Problem 3:
Related to: #43197
in the current scenario, when we set in a paragraph block a custom font size which happens to be the same size as a preset font size, the value is saved as if we had selected the preset font size. If someday this value of the preset font size is changed in theme.json, many paragraph sizes which we wanted to be custom, and not preset, in the first place, are going to be affected. This demonstrates that even when the preset font sizes aren't needed in a theme, there is still a need to adjust preset font sizes easily and with confidence in the global styles - not achieved by manually editing theme.json.
What is your proposed solution?
Please add the possibility to: edit/rename/add font size presets in the global styles sidebar.
Mockup:
The text was updated successfully, but these errors were encountered: