Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Commit

Permalink
Select the last child if no appender is present.
Browse files Browse the repository at this point in the history
  • Loading branch information
kjellr committed Nov 20, 2020
1 parent 826721c commit 70e6f3e
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 22 deletions.
29 changes: 23 additions & 6 deletions assets/css/ie-editor.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 23 additions & 6 deletions assets/css/style-editor.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions assets/sass/02-tools/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,13 @@
margin-top: 0;
}

// Needs to be the second-last child to avoid applying this to the appender.
> *:nth-last-child(2) {
// Last child that is not the appender.
> *:last-child():not(.block-list-appender) {
margin-bottom: 0;
}

// When selected, the last item becomes the second last because of the appender.
&.has-child-selected > *:nth-last-child(2) {
margin-bottom: 0;
}
}
9 changes: 1 addition & 8 deletions assets/sass/05-blocks/media-text/_editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@

.wp-block-media-text__content {
padding: var(--global--spacing-horizontal);

[data-block]:first-child {
margin-top: 0;
}

[data-block]:last-child {
margin-bottom: 0;
}
@include innerblock-margin-clear();
}

// Block Styles
Expand Down

0 comments on commit 70e6f3e

Please sign in to comment.