Skip to content

Backport: Bug fixes in theme json with fluid typography and spacing presets#3362

Closed
glendaviesnz wants to merge 2 commits into
WordPress:trunkfrom
glendaviesnz:fix/fluid-typography-bug
Closed

Backport: Bug fixes in theme json with fluid typography and spacing presets#3362
glendaviesnz wants to merge 2 commits into
WordPress:trunkfrom
glendaviesnz:fix/fluid-typography-bug

Conversation

@glendaviesnz

@glendaviesnz glendaviesnz commented Sep 29, 2022

Copy link
Copy Markdown

The new fluid typography setting is missing from the theme.json valid values in 6.1, which causes the value to be dropped from theme exports from the editor as reported here.

Trac ticket: https://core.trac.wordpress.org/ticket/56684

@ramonjd

ramonjd commented Sep 29, 2022

Copy link
Copy Markdown
Member

Thanks @glendaviesnz

This was an oversight on my part in the main Typgraphy PR that got merged #3237

@glendaviesnz glendaviesnz changed the title Port fluid typography theme.json setting Backport: Port fluid typography theme.json setting Sep 29, 2022
@glendaviesnz glendaviesnz changed the title Backport: Port fluid typography theme.json setting Backport: Bug fixes in theme json with fluid typography and spacing presets Sep 29, 2022
@ramonjd

ramonjd commented Sep 29, 2022

Copy link
Copy Markdown
Member

Thank you @glendaviesnz 💟

It's looking good. Should the spacing slug value be a string? E.g., "slug": "30"

2023 theme.json

"typography": {
    "dropCap": false,
    "fluid": true,
    "fontFamilies": [
...

"spacing": {
    "spacingScale": {
        "steps": 0
    },
    "spacingSizes": [
        {
            "size": "clamp(1.5rem, 5vw, 2rem)",
            "slug": "30",
            "name": "30"
        },

Export before

"typography": {
    "dropCap": false,
    "fontFamilies": [

....


"spacing": {
    "spacingScale": [],
    "spacingSizes": [
        {
            "name": "30",
            "size": "clamp(1.5rem, 5vw, 2rem)",
            "slug": 30
        },

After

"typography": {
    "dropCap": false,
    "fluid": true,
    "fontFamilies": [

...

"spacing": {
    "spacingScale": {
        "steps": 0
    },
    "spacingSizes": [
        {
            "name": "30",
            "size": "clamp(1.5rem, 5vw, 2rem)",
            "slug": 30
        },

@ramonjd ramonjd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving since the spacing slug number will be cast to a string when imported/injested.

The other two changes affect functionality and should be fixed.

@dream-encode

Copy link
Copy Markdown
Contributor

I was looking to merge this, but I want to make sure this comment by @tellthemachines is addressed in the final PR:
WordPress/gutenberg#44555 (review)

@dream-encode

Copy link
Copy Markdown
Contributor

After looking at the code and the comments, it appears the concerns are addressed. Prepping a merge commit to core.

@dream-encode

Copy link
Copy Markdown
Contributor

Merged into core in https://core.trac.wordpress.org/changeset/54360.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

3 participants