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

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 this issue Aug 10, 2023 · 3 comments
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.

Comments

@porg
Copy link

porg commented Aug 10, 2023

Original issue

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

@jordesign jordesign added [Type] Enhancement A suggestion for improvement. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Aug 10, 2023
@ouw-jvt
Copy link

ouw-jvt commented Oct 5, 2023

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

porg commented Oct 20, 2023

@ramonjd when do you plan to implement this?

@ramonjd
Copy link
Member

ramonjd commented Oct 22, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants