-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Global Styles: Allow saving, importing, exporting, copying from another theme without switching to it #45371
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
I had a slightly different but connected idea in #45452 |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This issue has been updated and labelled "Needs Dev", as we've settled on a design that could likely work for a first iteration. |
Currently, WP_REST_Global_Styles_Controller is limited to the active theme so it needs to be updated. I assume that once a style from an installed but not active theme is selected and you save it, the intention is that it gets saved in the active themes global style option in the database. I also assume that we need both the base theme.json and the style variation from the installed but not active themes. How do we handle font files that are used in style variations, and are placed in the installed but not active theme?
|
Yes, I suspect both of those are possible albeit rare occurrences. Perhaps we need to update the font selection control so that it displays an error/warning if the selected font cannot be found? |
Also should this include child themes? |
I am planning to take care of Save and Delete for user variations in #46952, covering point 1. from the main issue comment. I will probably not work on the other points but I'm assigning this to myself temporarily because working on import / export in parallel would be unfeasible. |
Thanks so much for jumping into this! Please share as you go where you might need help or reviews. |
Great work, that is exactly what I was hoping for here #60386. |
@scruffian great job getting #63318 merged to create a new public function to expose variations from other themes. Where does that leave us in terms of what's next? I see some performance issues mentioned in the PR reviews btw. |
In Global Styles > Browse styles, it should be possible to import, export, and save styles. The interface should accommodate all these flows:
The following mockups take a stab at the above, and may in some cases replace them. Here's importing a file:
Styles from other themes can be surfaced:
Saving customizations:
As a starting point, styles imported or copied from other themes retain their stylenames from those sources. But in the future, we could explore a create from scratch + rename flow, such as this:
Issue updated Nov 3.
Initial proposal
This issue has a great deal of overlap with #38333, but takes a slightly different approach in that it is meant to include a flow for importing and exporting from files. The goal is to use the same interface to accomplish three separate flows:
Incidentally, these flows may also solve #45210, and depending on feedback, we may merge this issue into 38333, or vice versa.
In the first case, a user has picked a style variation that's bundled with a theme, but has made no other customizations to it:
If customizations are made to a style, or if a style is imported:
This is a first iteration, let me know your thoughts.
The text was updated successfully, but these errors were encountered: