-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Template Switcher: Add theme preview #21768
Conversation
Size Change: +331 B (0%) Total Size: 842 kB
ℹ️ View Unchanged
|
packages/edit-site/src/components/template-switcher/theme-preview.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works very well! And the code looks good from my point of view.
I wonder if we should be displaying all of these previews on focus for use in a tabbing flow. 🤔 - But I don't think that concern should hold up this PR as none of the others work that way yet either. Thoughts for future iterations!
Indeed, I was also wondering about a11y implications but decided to hold off for now because the pre-existing template previews are also on-hover only. But yeah, definitely material for future iterations. |
14c131d
to
66d8d28
Compare
Some tests currently failing. Waiting for #21780 which should fix them. |
66d8d28
to
58b2810
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This worked as expected for me and the code looks good. 👍
In #21578, I added a few fields to Core's `/themes` endpoint, for use by the Site Editor's Template Switcher (see both #21578 and #21768). I then submitted those changes as a [PR](WordPress/wordpress-develop#222) against Core. That PR underwent a number of modifications and was eventually merged; the new fields will be part of the `/themes` endpoint exposed by Core starting from the next WP release. This PR updates the fields added by Gutenberg to follow the same semantics, as well as the callsites that use that endpoint.
Description
Add on-hover theme preview to site editor's template switcher (see mockups).
Fixes #20469.
How has this been tested?
Screenshots
Types of changes
Extends existing feature.
Checklist: