WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.51k stars 4.2k forks source link

Fluid typography: Numerical values shall support "ref" data type for better design synchronization e.g. typography.fluid.maxViewportWidth = "ref": "settings.layout.contentSize" #53525

Open porg opened 1 year ago

porg commented 1 year ago

Original issue

Additional user need

Add ref data type to fluid typography (goal of this issue)

@ramonjd pointed out this is possible by integrating the ref data type as defined in the theme.json schema for fluid typography, then you could assign like this:

    "settings": {
        "appearanceTools": true,
        "layout": {
            "contentSize": "840px",
            "wideSize": "1100px"
        },
        "typography": {
            "fluid": {
                "maxViewportWidth": {
                    "ref": "settings.layout.contentSize"
                },
                "minViewportWidth": "600px"
            }
        }
    },

Ticket triage

ouw-jvt commented 1 year ago

The ability to use references or css variables ( eg. var(--wp--custom--layout--content-size) as mentioned in #55070) in these fields would be very useful for child theme inheritance workflows, minimizing the need to duplicate modified values in a child theme's theme.json.

porg commented 1 year ago

@ramonjd when do you plan to implement this?

ramonjd commented 1 year ago

Thanks for the ping. The honest answer is I don't know. There a few competing priorities. I'd also want to ensure any lookup functions don't introduce any performance hits.

It is, however, still on the list so if someone else doesn't pick it up, I'd like to look at it when I get the opportunity.