Skip to content

Commit

Permalink
Allow for first or last elements being empty
Browse files Browse the repository at this point in the history
Adjust margins on second and second to last elements accordingly
  • Loading branch information
adamwoodnz committed Oct 23, 2024
1 parent 1833e3a commit 3b36b17
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mu-plugins/blocks/notice/postcss/style.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
display: none;
}

& p:first-child {
& p:first-child,
&:has(:first-child:empty) :nth-child(2) {
margin-block-start: 0;
}

Expand All @@ -40,7 +41,8 @@
*/

& p:last-child,
&:has(.o2-data) :nth-last-child(2) {
&:has(.o2-data) :nth-last-child(2),
&:has(:last-child:empty) :nth-last-child(2) {
margin-block-end: 0;
}

Expand Down

0 comments on commit 3b36b17

Please sign in to comment.