Skip to content

Commit

Permalink
Animate the canvas transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Apr 13, 2021
1 parent af1950d commit 3d94be2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/edit-post/src/components/visual-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { store as editPostStore } from '../../store';

export default function VisualEditor( { styles } ) {
const ref = useRef();

const { deviceType, isTemplateMode } = useSelect( ( select ) => {
const {
isEditingTemplate,
Expand All @@ -61,6 +62,8 @@ export default function VisualEditor( { styles } ) {
const { setIsEditingTemplate } = useDispatch( editPostStore );
const desktopCanvasStyles = {
height: '100%',
width: '100%',
margin: 0,
// Add a constant padding for the typewritter effect. When typing at the
// bottom, there needs to be room to scroll up.
paddingBottom: hasMetaBoxes ? null : '40vh',
Expand Down
12 changes: 12 additions & 0 deletions packages/edit-post/src/components/visual-editor/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.edit-post-visual-editor {
position: relative;
transition: padding 0.2s linear;
@include reduce-motion("transition");
padding: 0;

// The button element easily inherits styles that are meant for the editor style.
// These rules enhance the specificity to reduce that inheritance.
Expand Down Expand Up @@ -32,6 +35,15 @@
border: 1px solid $gray-300;
}
}

&.is-preview {
padding: $grid-unit-60;
}

.editor-styles-wrapper {
transition: all 0.2s linear;
@include reduce-motion("transition");
}
}

.editor-styles-wrapper {
Expand Down

0 comments on commit 3d94be2

Please sign in to comment.