Skip to content

Commit

Permalink
Don't render empty footer list items
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Sep 8, 2023
1 parent 4bea1d2 commit 0ff36d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions asset/css/list/list-item.less
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
}

footer {
&:not(:empty) {
padding-top: .5em;
}
padding-top: .5em;
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/Common/BaseListItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,14 @@ protected function createMain(): BaseHtmlElement
return $main;
}

protected function createFooter(): BaseHtmlElement
protected function createFooter(): ?BaseHtmlElement
{
$footer = new HtmlElement('footer');

$this->assembleFooter($footer);
if ($footer->isEmpty()) {
return null;
}

return $footer;
}
Expand Down

0 comments on commit 0ff36d9

Please sign in to comment.