Skip to content

[DevHub]Typography settings miss "defaultFontSizes" option #1913

Open

Description

@anssi-kokkonen

Issue Description

"defaultFontSizes": false is needed to override WP font size defaults, but this word is not found at all from relevant documentation. The attribute/option should be included and explained in the doc.

URL of the Page with the Issue

https://developer.wordpress.org/themes/global-settings-and-styles/settings/typography/

Section of Page with the issue

Probably "Registering custom font size presets"

Why is this a problem?

Confusion as to why my theme.json font size definitions are not applied. In my case the default was fluid up to 20px in size medium, while I was expecting 16px (1rem).

Suggested Fix

Mention that defaultFontSizes": false is necessary to ensure override of preset sizes (medium, large...)

Activity

  1. github-actions commented on May 9, 2025

    @github-actions

    Heads up @WordPress/docs-issues-coordinators, we have a new issue open. Time to use 'em labels.

  2. sohamjd commented on Jun 5, 2025

    @sohamjd

    /assign

  3. github-actions commented on Jun 5, 2025

    @github-actions

    Hey @sohamjd, thanks for your interest in this issue! 🍪🍪🍪
    If you have any questions, do not hesitate to ask them in our #docs Slack channel.
    Enjoy and happy contributing ❤️

  4. sohamjd commented on Jun 5, 2025

    @sohamjd

    "defaultFontSizes": false needs to be added to override the default theme font sizes, and the example needs to be updated for the same, as shown below along with the changed code after the image:

    Image

    {
    "settings": {
    "typography": {
    "defaultFontSizes": false,
    "fontSizes": [
    {
    "slug": "body",
    "size": "16px",
    "name": "Body"
    },
    {
    "slug": "heading",
    "size": "32px",
    "name": "Heading"
    }
    ]
    }
    }
    }

    Also, a note has to be added at the end to highlight the necessity of defaultFontSizes:false to define your own custom font sizes and replace the default set completely, by disabling the default font sizes explicitly. Below is the reference of the image how it can be done:

    Image

  5. github-actions commented on Jun 5, 2025

    @github-actions

    Heads up @docs-reviewers - the "[Status] Review" label was applied to this issue.

  6. github-actions commented on Jul 20, 2025

    @github-actions

    Heads up @kafleg @carolinan @TeBenachi - the "themes" label was applied to this issue.

  7. changed the title [-]Typography settings miss "defaultFontSizes" option[/-] [+][DevHub]Typography settings miss "defaultFontSizes" option[/+] on Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions