gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

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

Open porg opened this issue 3 years ago • 3 comments

Original issue

  • #53081
  • introduced minViewportWidth and maxViewportWidth as standalone variables for fluid typography.

Additional user need

  • It should be possible that minViewportWidth and maxViewportWidth can take variable values like contentSize and wideSize or the defined breakpoint variables to have a synchronized design experience with no need to manually update numerical values in multiple places.

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

  • Please assign to @ramonjd , he already agreed to do this feature
  • I created this as a standalone issue so that I can track its progress.
  • Requested to add it to #44888 → Wishlist

porg avatar Aug 10 '23 12:08 porg

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.

ouw-jvt avatar Oct 05 '23 15:10 ouw-jvt

@ramonjd when do you plan to implement this?

porg avatar Oct 20 '23 09:10 porg

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.

ramonjd avatar Oct 22 '23 14:10 ramonjd