Skip to content

Commit

Permalink
Move editor canvas and iframe sizing transitions to shared mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
jeryj committed Aug 2, 2024
1 parent 1a96985 commit 4fec73e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions packages/base-styles/_animations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
animation-fill-mode: forwards;
@include reduce-motion("animation");
}

@mixin editor-canvas-resize-animation() {
transition: all 0.5s cubic-bezier(0.65, 0, 0.45, 1);
@include reduce-motion("transition");
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ iframe[name="editor-canvas"] {
height: 100%;
display: block;
background-color: transparent;
@include editor-canvas-resize-animation;
}
3 changes: 1 addition & 2 deletions packages/block-editor/src/components/iframe/content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
.block-editor-iframe__html {
border: 0 solid $gray-300;
transform-origin: top center;
transition: all 0.5s cubic-bezier(0.65, 0, 0.45, 1);
@include reduce-motion("transition");
@include editor-canvas-resize-animation;
}

.block-editor-iframe__html.is-zoomed-out {
Expand Down
1 change: 0 additions & 1 deletion packages/block-editor/src/components/iframe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ function Iframe( {
style={ {
...props.style,
height: props.style?.height,
transition: 'all 0.5s cubic-bezier(0.65, 0, 0.45, 1)', // Maps to the .block-editor-iframe__html transition.
} }
ref={ useMergeRefs( [ ref, setRef ] ) }
tabIndex={ tabIndex }
Expand Down

0 comments on commit 4fec73e

Please sign in to comment.