-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Allow preset line height variables to be defined in experimental-theme.json #27100
Comments
👋 So, a while ago, a shared that we'd need presets for variables other than colors & font-sizes #23111 My thinking at that point was that they'd be coupled with some UI #23177 #23176 but that proved to be complex UX wise. My concern about lacking presets for those things was lessened when the custom CSS properties were added at #25446 From that on, theme authors could create their own presets without a coupled UI component at their convenience ― it was precisely created with line-height and spacing in mind! So, how this would be different than what we have today with |
I've evolved my view on this topic: the line I'd draw here is that we should only have presets that Gutenberg uses somehow. The rest falls in theme-land, as every theme author has different approaches to things and each one might want a different kind of presets. |
I see what you mean — the main issue I'm thinking of here is just a cognitive one: When authors are setting global styles rules for font family, font size, font decoration, and font styles. they're doing it in the Once there's more of a clear need for other common variables to be set there, I think that could go away, but it does feel a little weird. |
Can we add group or column height in theme.json...? |
This feature would be nice. Currently, we use just two or three line heights in our design, but we don't want the people in marketing to change it to any value; only specific values, similar to the color palette. This change would probably be very useful for a number of projects. Thank you. |
I'm thinking it may be more useful to register line heights for font sizes (or perhaps additionally). What if we did something more like what Tailwind does, where we could register line heights for font sizes? That would also solve the issue where headings with font sizes may have proper line height, but paragraph text with font sizes need manually applied line height to look better. Here's what Tailwind does: And here's what we could do: |
|
Stumbled upon this issue and this other issue while searching for a way to pair line heights to font sizes preset. Considering @richtabor's comment has a bunch of upvotes, and the issue has been noticed a few times, I'd love if we could unbury this issue from the dead. Perhaps we could start by agreeing on how the API could look like? @richtabor's proposal seems the most sensible to me. What do you folks suggest? @markhowellsmead it is about a different setting. This proposal is not about styling a global |
Thoughts on this @MaggieCabrera and @scruffian? I know you've done a good bit in theme.json/global styles. |
I think your comment is a good idea, but @afercia has a point mentioning that the UI is incomplete if we only show one of the two (font-size/line-height). If we are pairing them off in the code, that needs to be apparent to the user as well. |
not now, but I think it would make sense if presets worked in pairs if we implement what you said on your comment. |
I don't think we'd need to have a UI representing the line height addition, other than perish allowing the default value set in the control (like it does otherwise). I think this would be a nice improvement. |
It's currently possible (with Gutenberg 9.4) to assign
lineHeight
to many blocks withinexperimental-theme.json
:However, it's not yet possible to define the values for that as a typography preset. Instead, it's necessary to write these as custom variables:
(That's actually taken directly from the current documentation. 😄 )
Even if we don't make line heights available in the UI yet, we should consider allowing theme authors to register preset sizes in
global => settings => presets => typography => lineHeight
.The text was updated successfully, but these errors were encountered: