-
Notifications
You must be signed in to change notification settings - Fork 3
Varya: Gutenberg's line height control does not work in the editor. #37
Comments
Yup, that would be ideal. Gonna do some testing in a PR for this but should be pretty straight forward to add this kind of support. |
I did some digging on this its a little tough to follow how it’s intended to work. There appears to only be one variable The CSS-variable is applied to elements inline in the editor and the frontend. Its unclear how the CSS-variables are useful, since the result is an overriding inline style anyway. Not sure what the advantage is for this implementation. It’s essentially an inline style, and it seems to be locked away from any of the responsive or scoping techniques available with non-inline CSS-variables. It also feels like the new line-height option is a block-specific setting (meaning not global), but the way its implemented can have unintended global effects on the frontend. May need to do some extra styling to make sure that non-gutenberg areas are not impacted. There’s a few different ways to approach adding this support:
|
Thanks for digging and laying that out @allancole! My early thoughts:
we could refactor so that either: a) or b) tie
This doesn't seem like a good solution because it doesn't give us adequate design control right now. Also since "we’d need a way to set default line-heights for the editor and the front end—not sure if thats possible yet." I think this is only possible via an
I also think this is important: we need to advocate for more sensible design control via the right CSS variables. But that evolution is going to take way longer than our expectations for shipping this theme. |
Related Gutenberg PRs:
|
Solved by #44 |
Same issue as reported over in Automattic/themes#1895
Gutenberg 7.9 introduces a
--wp--typography--line-height
CSS variable when the user adjusts the line height in the sidebar. The specificity of Varya's CSS overrides this new rule, preventing it from kicking into effect.In general, how should we handle these new WP-provided variables? Should we just start migrating the names of the Varya variables each time one of these new ones becomes available?
The text was updated successfully, but these errors were encountered: