Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

Support WordPress 5.8 theme.json#20

Open
lgladdy wants to merge 10 commits into
roots:masterfrom
lgladdy:support-wp-theme-json
Open

Support WordPress 5.8 theme.json#20
lgladdy wants to merge 10 commits into
roots:masterfrom
lgladdy:support-wp-theme-json

Conversation

@lgladdy

@lgladdy lgladdy commented Jul 11, 2021

Copy link
Copy Markdown

This PR is based on the code in PR #19 as it is dependant

I added a new configuration option to enable WordPress 5.8 theme.json support.

Hopefully the updated README explains everything pretty well, but essentially there is a new configuration option, wp_theme_json which when enabled, will try and load the output option, then append the palette in the right place (settings.color.palette).

With this option, the user does not need to add_theme_support for a palette, and all required classes for the block editor are compiled automatically (as detailed in https://make.wordpress.org/core/2021/06/25/introducing-theme-json-in-wordpress-5-8/)

Edit: After submitting this PR, I realised that if the user isn't using mix with a setPublicPath, forcing the output path to "../" + output would put the file in the wrong place, so I added another new property output_prepend which just gets prepended to output to support writing theme.json outside of /public for those using mix/roots/sage, etc.

@lgladdy lgladdy marked this pull request as draft July 11, 2021 11:34
@lgladdy lgladdy marked this pull request as ready for review July 11, 2021 11:41
@Log1x Log1x self-requested a review August 26, 2021 18:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant