Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Spacing: replace var() format with var:preset|spacing|value #95

Closed
carolinan opened this issue Aug 23, 2022 · 2 comments
Closed

Spacing: replace var() format with var:preset|spacing|value #95

carolinan opened this issue Aug 23, 2022 · 2 comments

Comments

@carolinan
Copy link
Collaborator

Across the templates, the format var(--wp--preset--spacing--90) is used inside the JSON block comment.
For the code in the template to match the code of new blocks added in the block editor, this format should be used: var:preset|spacing|numeric-value
See #55 (comment)

@carolinan
Copy link
Collaborator Author

Updating it for the spacer block did not work:

<!-- wp:spacer {"height":"var:preset|spacing|40"} -->
<div style="height:var(--wp--preset--spacing--40)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
Block validation failed for `core/spacer` (Object).
Content generated by `save` function:
<div style="height:var:preset|spacing|40" aria-hidden="true" class="wp-block-spacer"></div>
Content retrieved from post body:
<div style="height:var(--wp--preset--spacing--40)" aria-hidden="true" class="wp-block-spacer"></div>

@mikachan
Copy link
Member

mikachan commented Sep 2, 2022

It looks like we've replaced all the possible spacing presets with the correct format across the templates.

The only ones left are the spacer blocks, but it looks like this currently isn't possible as the spacing presets are not valid height settings. I've opened up an issue for this: WordPress/gutenberg#43816

@mikachan mikachan closed this as completed Sep 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants