-
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
New presets for line height, padding, and margin #23111
Comments
By tying this with the work we're doing to be able to control the editor in a more fine-grained way, things like defining presets by the block will be possible. Theme authors will be enabled to do things like: make all font sizes available in the heading block, but only make the small & regular font-sizes available for a paragraph; the same for line-heights, and so on. |
cc @mtias @kjellr @jasmussen @ItsJonQ @youknowriad for thoughts. |
Yes, I think so. And even margin too. It also just so happens that Q is close to having great design tools available to handle these. |
Yes! I've updated the issue to better reflect my thinking: that all style attributes should have a matching preset. |
Is this a 5.5 must have? |
@ellatrix I was thinking that we should, yes. PR for line-height is ready and I hope to get it in for next Gutenberg version. There's a WIP PR for padding as well. For context, this is the current summary of the state of the new style props to be added in 5.5: #23177 (comment) |
I'm totally in for this. It would be very useful if the custom presets output a class instead of inlined styles. This is the way font sizes or colors work and will enable theme authors to apply line-height, paddings and margins per media query, choose whether they prefer to use px, em or rem units, implement golden ratios, etcetera. It's far more flexible than a fixed px value. Some default keywords can help to guide theme developers and to allow cross-theme compatibility. Maybe the ones already in use for font-size (small, normal, medium, large, huge)? I was also thinking if this might apply to the spacer block. |
I've removed this ticket from the "5.5 must-have" project. In implementing this, some issues were raised in terms of design (ui complexity) & engineering (consolidate how we store style attributes in markup, etc) that need time to figure out, so they're best simmered. |
Going to close this one. After what Matías suggested at #23177 (comment) and conversations with Jorge, this no longer seems necessary. There may be better ways to do this (like block styles). We can always re-open later if it becomes relevant again. |
Currently, themes can express their design choices for colors, gradients, and font sizes via presets, pre-defined sets of values users will see in the editor. In looking at the recently added style attributes (line-height, padding) and the ones that are coming next (margin) #22700 I was thinking about how themes can express their design choices for these properties, especially in line of the growing use of grid systems to power the design of sites by agencies and theme builders.
Should we expand the preset mechanism to line-height, padding, and margin? This will work exactly like colors and font-sizes work today:
Tasks
The text was updated successfully, but these errors were encountered: