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

Support WordPress 5.8 theme.json #20

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

lgladdy
Copy link

@lgladdy lgladdy commented Jul 11, 2021

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant