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

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

Closed

Conversation

glendaviesnz
Copy link

@glendaviesnz glendaviesnz commented Sep 29, 2022

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
Copy link
Member

ramonjd commented Sep 29, 2022

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
Copy link
Member

ramonjd commented Sep 29, 2022

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
        },

Copy link
Member

@ramonjd ramonjd left a comment

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
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
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
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