Skip to content

Global Styles: Allow saving, importing, exporting, copying from another theme without switching to it #45371

@jasmussen

Description

@jasmussen

In Global Styles > Browse styles, it should be possible to import, export, and save styles. The interface should accommodate all these flows:

  1. Allow saving user variations for each bundled style (i.e. customized “dark” variation) (same as Global Styles: Managing style variations #38333)
  2. Load style variations from a file
  3. Provide access to styles from other themes without switching to them (related to Global Styles: Allow access to style variations from any theme #45452)
  4. Provide an implicit warning about losing style customizations (related to Warn that customisations will be lost on style variation switch #45210, Custom colors are lost when styles are changed #48407, Style Variations: Add warning when custom styles will be lost #40561)
  5. Allow exporting, deleting styles

The following mockups take a stab at the above, and may in some cases replace them. Here's importing a file:

Import styles from file

  • Import file exists in ellipsis menu
  • Plus exists to create a style from scratch (separate future feature)

Styles from other themes can be surfaced:

Styles from other themes you have installed can also be leveraged

  • The "Theme styles" section acts as a ToolsPanel, showing by default the active theme styles, letting you toggle on styles from other installed themes.

Saving customizations:

Saving customizations

  • Activating a style from a theme doesn't automatically save it as a custom style.
  • But making any customizations to the style makes it show up under "Custom styles", with a blue dot. If you save using Multi Entity saving, or using the dropdown, the blue dot disappears.
  • The ellipsis under custom styles allow saving, deleting, exporting.

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:

Creating from scratch


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:

  1. Allow saving user variations for each bundled style (i.e. customized “dark” variation)
  2. Load style variations from a file (import)
  3. Copy global styles from another theme without switching to that theme (import)
  4. Export, to enable items 2 and 3

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:

User has no customizations
  • Chosen style shows as active in the list of bundled theme styles
  • An ellipsis menu allows importing, exporting, and saving a style

If customizations are made to a style, or if a style is imported:

User has customizations
  • Customized style shows up in "Unsaved styles" section, clearly delineated as separate from the them bundled styles
  • Ellipsis menu shows uption to save or delete
  • If saved, the style will appear in a new section, called "Custom styles"
  • If further customizations are made, the "Unsaved styles" section appears again

This is a first iteration, let me know your thoughts.

Metadata

Metadata

Labels

Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonNeeds DevReady for, and needs developer efforts[Type] EnhancementA suggestion for improvement.

Type

No type

Projects

Status

💻 Needs development

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions