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

Update documentation for theme.json version 3 #61221

Merged
merged 22 commits into from Apr 30, 2024
Merged

Conversation

ajlende
Copy link
Contributor

@ajlende ajlende commented Apr 29, 2024

Dev Note 📝

See #58409 (comment)

What?

Updates documentation around theme.json version 3.

Why?

Follow-up to #58409 to better document theme.json version 3.

How?

  • Fixes the menu (docs/manifest.json) and TOC (docs/toc.json).
  • Fixes hand-written TOC in reference-guides.
  • Fixes typo in migrations heading.
  • Fixes incorrect wp version in v3 reference.
  • Clarifies the migration process even more.
  • Updates documentation to hopefully help with some confusion on backwards compatibility.
    • Updates description for the version property in global-settings-and-styles.md
    • Adds notices for backwards compatibility in all theme.json version references.
  • Updates references to theme.json "version": 3 in docs.
  • Remove changes from v2 docs since wp 6.5 release to be consistent with what would appear in the JSON schema file.
  • Other assorted fixes to related documentation in files that I was working in.

Testing Instructions

Proofread docs and check for working links.

Testing Instructions for Keyboard

Screenshots or screencast

Copy link

github-actions bot commented Apr 29, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ajlende <ajlende@git.wordpress.org>
Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
Co-authored-by: juanmaguitar <juanmaguitar@git.wordpress.org>
Co-authored-by: oandregal <oandregal@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ajlende ajlende added the [Type] Developer Documentation Documentation for developers label Apr 29, 2024
@ajlende ajlende self-assigned this Apr 29, 2024

## Settings

### appearanceTools

Setting that enables the following UI tools:

- background: backgroundImage, backgroundSize
- background: backgroundImage
Copy link
Member

Choose a reason for hiding this comment

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

Why is this here removed? That option was introduced in 6.5 and therefore exists in version 2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for flagging 🙂

I just removed everything I found in the diff from wp/6.5...HEAD.

diff --git a/docs/reference-guides/theme-json-reference/theme-json-living.md b/docs/reference-guides/theme-json-reference/theme-json-living.md
index c58b8b3239..0c852324ba 100644
--- a/docs/reference-guides/theme-json-reference/theme-json-living.md
+++ b/docs/reference-guides/theme-json-reference/theme-json-living.md
@@ -31,9 +27,9 @@ Code editors can pick up the schema and can provide helpful hints and suggestion
 
 Setting that enables the following UI tools:
 
-- background: backgroundImage
+- background: backgroundImage, backgroundSize
 - border: color, radius, style, width
-- color: link
+- color: link, heading, button, caption
 - dimensions: aspectRatio, minHeight
 - position: sticky
 - spacing: blockGap, margin, padding
@@ -97,6 +93,7 @@ Settings related to colors.
 | text | boolean | true |  |
 | heading | boolean | true |  |
 | button | boolean | true |  |
+| caption | boolean | true |  |
 
 ---
 
@@ -107,6 +104,7 @@ Settings related to background.
 | Property  | Type   | Default | Props  |
 | ---    | ---    | ---    |---   |
 | backgroundImage | boolean | false |  |
+| backgroundSize | boolean | false |  |
 
 ---
 
@@ -161,7 +159,7 @@ Settings related to spacing.
 
 | Property  | Type   | Default | Props  |
 | ---    | ---    | ---    |---   |
-| blockGap | undefined | null |  |
+| blockGap | boolean, null | null |   |
 | margin | boolean | false |  |
 | padding | boolean | false |  |
 | units | array | px,em,rem,vh,vw,% |  |
@@ -177,12 +175,14 @@ Settings related to typography.
 
 | Property  | Type   | Default | Props  |
 | ---    | ---    | ---    |---   |
+| defaultFontSizes | boolean | true |  |
 | customFontSize | boolean | true |  |
 | fontStyle | boolean | true |  |
 | fontWeight | boolean | true |  |
-| fluid | undefined | false |  |
+| fluid | object, boolean | false | _{maxViewportWidth, minFontSize, minViewportWidth}_  |
 | letterSpacing | boolean | true |  |
 | lineHeight | boolean | false |  |
+| textAlign | boolean | true |  |
 | textColumns | boolean | false |  |
 | textDecoration | boolean | true |  |
 | writingMode | boolean | false |  |
@@ -266,6 +266,7 @@ Typography styles.
 | fontWeight | string, object |  |
 | letterSpacing | string, object |  |
 | lineHeight | string, object |  |
+| textAlign | string |  |
 | textColumns | string |  |
 | textDecoration | string, object |  |
 | writingMode | string, object |  |

If backgroundSize was added in 6.5, the schema and docs must have been updated after the release and must not have been backported to the wp/6.5 branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Opened #61264 for those backports to 6.5 to fix up the schemas for that version.

Copy link
Member

@fabiankaegy fabiankaegy left a comment

Choose a reason for hiding this comment

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

Left one comment that I think requires a change. But besides that the updates look great 👍

@juanmaguitar
Copy link
Contributor

juanmaguitar commented Apr 30, 2024

@ajlende, is there any communication to the community (#dev-notes, #gutenberg-new, ...), announcing this update of theme.json from v2 to v3 and providing some context about this update?

As per #40232 (led by @oandregal), it seems this update was made some time ago.

There was a post explaining the update to v2 of theme.json (Updates for Settings, Styles, and theme.json) but I haven't found any for the migration to v3

I think it would be useful for developers to have a link from the docs to such a post in the same way there is one for v2 at Block Editor Handbook > Reference Guides > Theme.json Reference > Migrating to Newer Versions

Refer to the dev note for the release and the reference documents for the respective v1 and v2 versions.

@oandregal
Copy link
Member

As per #40232 (led by @oandregal), it seems this update was made some time ago.

That PR was closed and not merged. The one that updated the version is #58409 as far as I'm aware, which is a change that will land in 6.6.

@juanmaguitar juanmaguitar added the Needs Dev Note Requires a developer note for a major WordPress release cycle label Apr 30, 2024
@juanmaguitar
Copy link
Contributor

juanmaguitar commented Apr 30, 2024

That PR was closed and not merged.

@oandregal You're right 🤦‍♂️ Thanks for the clarification

The one that updated the version is #58409 as far as I'm aware, which is a change that will land in 6.6.

@ajlende I see now there's a DevNote in progress

@juanmaguitar juanmaguitar removed the Needs Dev Note Requires a developer note for a major WordPress release cycle label Apr 30, 2024
@ajlende ajlende enabled auto-merge (squash) April 30, 2024 17:27
@ajlende ajlende merged commit d36b40d into trunk Apr 30, 2024
60 checks passed
@ajlende ajlende deleted the update/theme-json-v3-docs branch April 30, 2024 17:45
@github-actions github-actions bot added this to the Gutenberg 18.3 milestone Apr 30, 2024
@ajlende
Copy link
Contributor Author

ajlende commented Apr 30, 2024

Looks like things aren't rendering properly on the website. I'll be adding another follow-up to fix that until whatever markdown parser is being used for wordpress.org gets fixed.

Is there a good way to preview this? Because it renders just fine in GitHub and my local markdown previewer.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants