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

theme.json v2: track changes #34349

Open
oandregal opened this issue Aug 27, 2021 · 3 comments
Open

theme.json v2: track changes #34349

oandregal opened this issue Aug 27, 2021 · 3 comments

Comments

@oandregal
Copy link
Member

@oandregal oandregal commented Aug 27, 2021

Part of #20331

This issue is to track the changes we need to introduce in WordPress 5.9, which we should match to a new schema for theme.json.

  • Update version to 2.
  • Consolidate the names that already landed and add migration from v1 to v2:
    • Rename spacing.customMargin to spacing.margin.
    • Rename spacing.customPadding to spacing.padding.
    • Rename typography.customLineHeight to typography.lineHeight.
  • Add the new properties to VALID_SETTINGS and VALID_STYLES.
@oandregal
Copy link
Member Author

@oandregal oandregal commented Aug 27, 2021

In origin, we used the custom* prefix for things that had both a preset and custom colors added by the user. For example, color.customGradient means the users can't use the custom colors in gradients, they are limited to preset gradients. However, color.link means the users can't set link color.

We should remove the custom* prefix those properties that don't need it: spacing.margin, spacing.padding, typography.lineHeight.

@oandregal
Copy link
Member Author

@oandregal oandregal commented Aug 27, 2021

cc @mtias @youknowriad @mcsf @jorgefilipecosta @gziolo @aaronrobertshaw @ramonjd

We can implement the migration from v1 to v2 for the properties above, as we did in the plugin when we introduced v1 (see), so in theme.json you'd use the name without the custom prefix.

I wonder how this affects the "internal" names: ideally, the names of the properties in the __experimentalFeatures passed to the client can be also updated as well as the store. I understand this may require 3rd parties that hook into the block settings filter to update their filters, if they modify these values. Is this a reasonable request? I think it is, because a theme.json v2 could introduce shape changes anyway.

@mtias
Copy link
Contributor

@mtias mtias commented Aug 27, 2021

We should perhaps leave the renaming for when we stabilize and remove the __experimental.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants