You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Custom font sizes currently can only be specified in terms of pix, em, or rem. In some cases, it makes most sense for fonts to scale with the screen (vh, vw, vmin, and vmax units). This is implicitly recognized by the "fluid" font sizes allowed in the non-custom font sizes within themes.json. and some editors might, for reasons of their own, prefer to use other font size types (ex, percentage, lh, rlh, and so on). Currently, there appears to be no way to do this, except with custom CSS. See my WordPress.org forum post on the topic for a little bit of additional discussion.
What is your proposed solution?
Currently, the theme.json file supports a "spacing" section, with a subsection of "units." This allows me to add any units I'd like to the theme editor for custom sizing of many objects (which I've tested successfully by adding vmin and vmax), but fonts do not honor this. A similar construct should be added into the "typography" section. Presently, "customFontSize" is only a boolean, but there needs to be some sort of "units" option that can be applied to those custom font sizes. My recommendation is to simply add a "units" section that only applies when "customFontSize" is true. That seems simpler than making "customFontSize" a container for more variables, thereby breaking compatibility with the current schema.
Alternate solution: Allow a blank option for units, such that users can enter free-text into the custom size (for any units, not just fonts). That would further allow users to make use of more advanced length choices, such as "calc()"
The text was updated successfully, but these errors were encountered:
Thanks for raising this suggestion @gungfujoe - I see there is an existing issue regarding additional/relative font sizes for fonts - so I'll close this issue in favour of that one.
What problem does this address?
Custom font sizes currently can only be specified in terms of pix, em, or rem. In some cases, it makes most sense for fonts to scale with the screen (vh, vw, vmin, and vmax units). This is implicitly recognized by the "fluid" font sizes allowed in the non-custom font sizes within themes.json. and some editors might, for reasons of their own, prefer to use other font size types (ex, percentage, lh, rlh, and so on). Currently, there appears to be no way to do this, except with custom CSS. See my WordPress.org forum post on the topic for a little bit of additional discussion.
What is your proposed solution?
Currently, the theme.json file supports a "spacing" section, with a subsection of "units." This allows me to add any units I'd like to the theme editor for custom sizing of many objects (which I've tested successfully by adding vmin and vmax), but fonts do not honor this. A similar construct should be added into the "typography" section. Presently, "customFontSize" is only a boolean, but there needs to be some sort of "units" option that can be applied to those custom font sizes. My recommendation is to simply add a "units" section that only applies when "customFontSize" is true. That seems simpler than making "customFontSize" a container for more variables, thereby breaking compatibility with the current schema.
Alternate solution: Allow a blank option for units, such that users can enter free-text into the custom size (for any units, not just fonts). That would further allow users to make use of more advanced length choices, such as "calc()"
The text was updated successfully, but these errors were encountered: