Skip to content

Commit

Permalink
perf(layout): optimize the main block height calculation (#1249)
Browse files Browse the repository at this point in the history
If the post content height is smaller than the panel, there will be a large blank space between the bottom of the post and "Further Reading" section.
  • Loading branch information
cotes2020 authored Sep 18, 2023
1 parent 726085c commit 73e171b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
{% include sidebar.html lang=lang %}

<div id="main-wrapper" class="d-flex justify-content-center">
<div class="container px-xxl-5">
<div class="container d-flex flex-column px-xxl-5">
{% include topbar.html lang=lang %}

<div class="row">
<div class="row flex-grow-1">
<main
aria-label="Main Content"
class="col-12 col-lg-11 col-xl-9 px-md-4{% unless has_tail %} pb-5{% endunless %}"
Expand Down
9 changes: 4 additions & 5 deletions _sass/addon/commons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ i {

main {
line-height: 1.75;
min-height: calc(100vh - $topbar-height - $footer-height);

h1 {
margin-top: 2rem;
Expand Down Expand Up @@ -1127,6 +1126,10 @@ search {
position: relative;

@include pl-pr(0);

> .container {
min-height: 100vh;
}
}

#topbar-wrapper.row,
Expand Down Expand Up @@ -1280,10 +1283,6 @@ search {
}
}

main {
min-height: calc(100vh - $topbar-height - $footer-height-large);
}

footer {
@include slide;

Expand Down

0 comments on commit 73e171b

Please sign in to comment.