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

Styles: integrate global styles revisions into the top-level styles panel #67717

Open
ramonjd opened this issue Dec 9, 2024 · 1 comment
Open
Assignees
Labels
Design System Issues related to the system of combining components according to best practices. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.

Comments

@ramonjd
Copy link
Member

ramonjd commented Dec 9, 2024

Enable previewing and applying global styles revisions in the dedicated styles screen in the site editor view menu.

As with the editor, revisions should be able to be loaded for the style book and the currently-previewed template.

The exercise might also require some rewiring of how the editor canvas displays these views, which, currently, involve the complex juggling of states across the site editor: style-book, global-styles-revisions, global-styles-revisions:style-book.

Here's how it could work (taken from the hacky test branch):

Kapture.2024-12-09.at.11.02.47.mp4

Related issues

@ramonjd ramonjd added [Type] Enhancement A suggestion for improvement. Design System Issues related to the system of combining components according to best practices. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Dec 9, 2024
@ramonjd ramonjd self-assigned this Dec 9, 2024
@ramonjd
Copy link
Member Author

ramonjd commented Dec 9, 2024

When hacking away at #67660 I made the following notes, based on the assumption that a top-level styles revisions panel would follow the same canvas logic as its editor counterpart:

  • Site editor view and edit modes need to send the StyleBook component different props, e.g., enableResizing, showCloseButton, showTabs, isSelected.
  • The same type of editorCanvasContainerView state comparison that's done for the editor is required for view mode. It's not pretty.
  • Following the above point, switching between revisions and styles panels should remember the user's choice of preview.
  • If we keep the canvas "clickable", should it open the revisions panel in the editor?
  • Does the stylebook/revisions canvas need a close button at all? I don't think so. Maybe it's more accessible to keep it.
  • It would be great to centralize this and extract it from the editor completely. It would make maintenance and development easier, but I'm not sure it needs to be a dependency of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design System Issues related to the system of combining components according to best practices. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.
Projects
Status: No status
Development

No branches or pull requests

1 participant