Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

theme.json default heading property doesn't show in h1-h6 tabs #65353

Closed
2 tasks done
mr660 opened this issue Sep 15, 2024 · 1 comment
Closed
2 tasks done

theme.json default heading property doesn't show in h1-h6 tabs #65353

mr660 opened this issue Sep 15, 2024 · 1 comment
Labels
[Type] Bug An existing feature does not function as intended

Comments

@mr660
Copy link

mr660 commented Sep 15, 2024

Description

I'm developing custom FSE theme. I wanted to define default lineHeight for all my headings.

Setting up styles.elements.heading.typography.lineHeight doesn't show in admin panel in sections related to h1-h6 (it displays default wordpress value which is 1.5). It does show in "All" section.

I expect it to display default value i've set up for all headings when i didn't specify value for h1-h6 separately.

all
h1-h6

theme.json:

{
  "version": 3,
  "settings": {
    "typography": {
      "defaultFontSizes": false,
      "fluid": true,
      "lineHeight": true,
      "fontSizes": [
        {
          "name": "Headline 1",
          "fluid": {
            "min": "30px",
            "max": "98px"
          },
          "size": "98px",
          "slug": "h1"
        },
        {
          "name": "Headline 2",
          "fluid": {
            "min": "26px",
            "max": "61px"
          },
          "size": "61px",
          "slug": "h2"
        },
        {
          "name": "Headline 3",
          "fluid": {
            "min": "20px",
            "max": "41px"
          },
          "size": "41px",
          "slug": "h3"
        },
        {
          "name": "Headline 4",
          "fluid": {
            "min": "18px",
            "max": "35px"
          },
          "size": "35px",
          "slug": "h4"
        },
        {
          "name": "Headline 5",
          "fluid": {
            "min": "16px",
            "max": "24px"
          },
          "size": "24px",
          "slug": "h5"
        },
        {
          "name": "Headline 6",
          "fluid": {
            "min": "14px",
            "max": "20px"
          },
          "size": "20px",
          "slug": "h6"
        },
        {
          "name": "Subtitle 1",
          "size": "16px",
          "slug": "subtitle-1"
        },
        {
          "name": "Subtitle 2",
          "size": "14px",
          "slug": "subtitle-2"
        }
      ]
    }
  },
  "styles": {
    "elements": {
      "heading": {
        "typography": {
          "lineHeight": "1.1"
        }
      },
      "h1": {
        "typography": {
          "fontSize": "var:preset|font-size|h-1"
        }
      },
      "h2": {
        "typography": {
          "fontSize": "var:preset|font-size|h-2"
        }
      },
      "h3": {
        "typography": {
          "fontSize": "var:preset|font-size|h-3"
        }
      },
      "h4": {
        "typography": {
          "fontSize": "var:preset|font-size|h-4"
        }
      },
      "h5": {
        "typography": {
          "fontSize": "var:preset|font-size|h-5"
        }
      },
      "h6": {
        "typography": {
          "fontSize": "var:preset|font-size|h-6"
        }
      }
    }
  }
}

Step-by-step reproduction instructions

  1. Set up theme.json like in example
  2. Go to Appearance->Editor
  3. Go to Styles
  4. Open Styles side panel
  5. Go to Typography->Headings
  6. "All" Headings shows line-height set to 1.1
  7. H1 to H6 displays 1.5

Screenshots, screen recording, code snippet

No response

Environment info

  • Wordpress 6.6.2
  • PHP 8.3.11
  • nginx/1.27.1
  • MariaDB 11.5.2

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes
@mr660 mr660 added the [Type] Bug An existing feature does not function as intended label Sep 15, 2024
@carolinan
Copy link
Contributor

Hi!
This issue is already discussed in #64670, please continue the conversation there. I am closing this as a duplicate.

@carolinan carolinan closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants