Theme Export: Exporting a child theme as a standalone theme creates a lot of invalid/nonsensical data in theme.json #51390
Labels
[Feature] Site Editor
Related to the overarching Site Editor (formerly "full site editing")
Needs Testing
Needs further testing to be confirmed.
[Type] Bug
An existing feature does not function as intended
Description
Expectation: The serialized
theme.json
in the new standalone theme is a proper merge of parent theme + child theme + current user customizations (as in database).Actual: Far from that. The resulting theme.json is very broken in many regards ( I identified 4 flaws, the expert probably even more). See details below.
Step-by-step reproduction instructions
Reproduction
I had tt3dd as a child block theme of Twenty Twenty Three (aka TT3).
Had too many issues with child block theme. Decided to abandon this workflow paradigm and better work with a standalone theme which starts as a copy of the original TT3.
The child theme tt3dd may has its own mini theme.json (in my case 320 bytes, override only, had no effect anyhow) or not have any own theme.json. The outcome of the following export was the same in both situations for me! See file:
theme-tt3dd-export-v1.json.txt
With the child theme tt3dd as the active theme I went to: Site Editor → Top level context menu → TOOLS → Export.
This exported the standalone theme which is a merge of the parent theme and the child theme into a ZIP file. Performed some renaming and adaptations in theme.css and functions.php but left the theme.json untouched. This new standalone theme (based upon TT3) now goes by the theme-slug "dd".
Observed anomalies of the theme.json export from an active child theme
I. In the original Twenty Twenty Three theme (see: theme-tt3.json.txt) the palette exists only once:
II. In theme-tt3dd-export-v1.json.txt there are several anomalies
settings → blocks → core/group → color → palette
settings → color → palette → slug: custom-plain-inline-links
Some of the arrays "at the end of a branch" (no more children) have there child attributes in different order in comparison to the original, e.g.
"fluid": { "max": "1.875rem", "min": "1.75rem" }
vs."fluid": { "min": "1.75rem", "max": "1.875rem" }
.Some in the original only have slug+size vs. slug+size+name in the export, e.g. an extra name: "Extra Large" in addition to the slug: "x-large".
Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
No
The text was updated successfully, but these errors were encountered: