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).
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.
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 theoutput
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 propertyoutput_prepend
which just gets prepended tooutput
to support writing theme.json outside of/public
for those using mix/roots/sage, etc.