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 schema: Add sticky position to settings, minHeight to styles #48948

Merged

Conversation

andrewserong
Copy link
Contributor

@andrewserong andrewserong commented Mar 9, 2023

What?

Update theme.json schema to include position.sticky within the settings schema, and dimensions.minHeight within the styles schema.

Note that while fixed is treated as a valid value in code, it is not yet in use by any core blocks. To avoid folks thinking they can start using it by switching fixed to true, I've left it off this change for now.

Why?

Now that the sticky position support has been added to the Group block, and the feature will be in 6.2, ensure the setting exists within the theme.json schema.

Also, dimensions.minHeight was missing from the style schema, so that's been added now.

How?

  • Update the theme.json schema to reflect that position.sticky is a valid setting (boolean) — note that position is not valid as a style within theme.json as it is intended to be set at the individual block level within the editor.
  • Add dimensions.minHeight as a valid style.

Testing Instructions

Proofread to make sure the changes look correct, and are added in the right places. I wasn't too sure how else to test it manually?

@andrewserong andrewserong added [Type] Developer Documentation Documentation for developers [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. labels Mar 9, 2023
@andrewserong andrewserong self-assigned this Mar 9, 2023
@andrewserong andrewserong requested a review from ajlende as a code owner March 9, 2023 03:59
Copy link
Contributor

@aaronrobertshaw aaronrobertshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for bringing the schema up-to-date with the current state of position support @andrewserong 👍

The decision to omit references to fixed position support makes sense.

LGTM!

@andrewserong andrewserong changed the title Theme JSON schema: Add sticky position to settings Theme JSON schema: Add sticky position to settings, minHeight to styles Mar 9, 2023
Copy link
Contributor

@aaronrobertshaw aaronrobertshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for also adding the missing dimensions to the schema styles and settings.

It looks like this has exposed a problem with the previous dimensions setting definition. It needs the object type as well I think.

@andrewserong
Copy link
Contributor Author

Thanks for the reviews @aaronrobertshaw! Added the missing line, so 🤞 should be good now.

Copy link
Contributor

@aaronrobertshaw aaronrobertshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest tweak LGTM. Once the e2es pass, this should be good to go. 🚢

@andrewserong andrewserong enabled auto-merge (squash) March 9, 2023 04:37
@andrewserong andrewserong merged commit 564b6d5 into trunk Mar 9, 2023
@andrewserong andrewserong deleted the update/theme-json-schema-to-include-sticky-position branch March 9, 2023 05:10
@github-actions github-actions bot added this to the Gutenberg 15.4 milestone Mar 9, 2023
@andrewserong andrewserong added the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Mar 13, 2023
@andrewserong
Copy link
Contributor Author

I've added the backport label — I'm not sure if it's needed for schema updates? It was flagged in this issue (#49010), though, so to be on the safe side, I've added the label.

@pbiron
Copy link

pbiron commented Mar 13, 2023

All the references I see to the schema just point at https://raw.githubusercontent.com/WordPress/gutenberg/trunk/schemas/json/theme.json, so I don't think the schema is "distributed" with WP installations, so there's nothing that needs to be done there (since that now contains the new properties).

With regard to merging this into core, ,

I suspect that the .md file will get incorporated into the the relevant handbook page during some automated sync'ing that happens after a WP release, but probably best to check with the release/documentation leads.

Mamaduka pushed a commit that referenced this pull request Mar 14, 2023
…es (#48948)

* Theme JSON schema: Add sticky position to settings

* Add dimensions.minHeight to styles

* Add missing type: objects line
@Mamaduka
Copy link
Member

I just cherry-picked this PR to the wp/6.2 branch to get it included in the next release: 33001e5

@Mamaduka Mamaduka removed the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants