Skip to content

Commit

Permalink
Site editor: Add hover animation to site editor canvas (#48575)
Browse files Browse the repository at this point in the history
  • Loading branch information
glendaviesnz committed Mar 3, 2023
1 parent 6be1e86 commit cae03de
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
// Forming a "block formatting context" to prevent margin collapsing.
// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
`.is-root-container { display: flow-root; }
body { position: relative; }`
body { position: relative;
${ canvasMode === 'view' ? 'cursor: pointer;' : '' }}}`
}</style>
{ enableResizing && (
<style>
Expand Down
14 changes: 14 additions & 0 deletions packages/edit-site/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,20 @@ export default function Layout() {
{ canvasResizer }
{ !! canvasSize.width && (
<motion.div
whileHover={
isEditorPage && canvasMode === 'view'
? {
scale: 1.01,
transition: {
duration:
disableMotion ||
isResizing
? 0
: 0.2,
},
}
: {}
}
initial={ false }
layout="position"
className="edit-site-layout__canvas"
Expand Down

1 comment on commit cae03de

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in cae03de.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4322213273
📝 Reported issues:

Please sign in to comment.