Skip to content

Commit

Permalink
Hide the animation for default appenders and placeholders.
Browse files Browse the repository at this point in the history
  • Loading branch information
kjellr committed Aug 7, 2019
1 parent 918c521 commit 786c0a6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions assets/stylesheets/_animations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@
animation-fill-mode: forwards;
@include reduce-motion("animation");
}

@mixin edit-post__inner-blocks-padding-negative-animation($speed: 0.1s, $delay: 0s) {
animation: edit-post__inner-blocks-padding-negative-animation $speed ease-out $delay;
animation-fill-mode: forwards;
@include reduce-motion("animation");
}
6 changes: 6 additions & 0 deletions packages/block-library/src/columns/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,10 @@ div.block-core-columns.is-vertically-aligned-bottom {
margin: -$block-padding;
width: calc(100% + #{$block-padding * 2});
}

// Negate the animation for the appender and placeholders.
> .block-editor-block-list__layout > .block-list-appender,
> .components-placeholder {
@include edit-post__inner-blocks-padding-negative-animation();
}
}
5 changes: 5 additions & 0 deletions packages/block-library/src/group/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@
> .wp-block-group__inner-container > .block-editor-inner-blocks {
padding: $block-padding;
@include edit-post__inner-blocks-padding-animation();

// Negate the animation for the appender.
> .block-editor-block-list__layout > .block-list-appender {
@include edit-post__inner-blocks-padding-negative-animation();
}
}

&:not(.has-background) > .wp-block-group__inner-container > .block-editor-inner-blocks > .block-editor-block-list__layout {
Expand Down
10 changes: 10 additions & 0 deletions packages/edit-post/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@
}
}

// This negates the animation above, and is used on child elements that don't require animation.
@keyframes edit-post__inner-blocks-padding-negative-animation {
from {
transform: scale(0.99);
}
to {
transform: scale(1);
}
}

// In order to use mix-blend-mode, this element needs to have an explicitly set background-color
// We scope it to .wp-toolbar to be wp-admin only, to prevent bleed into other implementations
html.wp-toolbar {
Expand Down

0 comments on commit 786c0a6

Please sign in to comment.