Skip to content

Commit

Permalink
🎨 💄 layouts(index): Reduce padding around index text (unicef#178)
Browse files Browse the repository at this point in the history
This commit moves the index page text (if provided in the Hugo site)
into the `<section>` tag for the main topics. It uses a Bootstrap
container inside of the `<section>` and therefore exists inside of the
styling rules for the section instead of working against its styling.

This reduces the large amount of whitespace that exists between the
search bar section of the site and the topics. It is easier to realize
there is more content.

Related to unicef#154.

Signed-off-by: Justin W. Flory (he/him) [UNICEF Innovation] <jflory@unicef.org>
  • Loading branch information
jwflory authored Oct 7, 2022
1 parent bfd2c41 commit c31ac43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ h4:hover a {

.section,
section.main-section {
padding-top: calc(250px - 4vw);
padding-top: 10vh;
}

@media (max-width: 768px) {
Expand Down
16 changes: 8 additions & 8 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{{ define "main" }}

{{ if .Content }}
<section class="section text-center pb-0">
<div class="container">
{{ .Content }}
</div>
</section>
{{ end }}
{{ "<!-- topics -->" | safeHTML }}
<section class="section">
{{ if .Content }}
{{ "<!-- index page text -->" | safeHTML }}
<div class="container text-center pb-5">
{{ .Content }}
</div>
{{ "<!-- /index page text -->" | safeHTML }}
{{ end }}
{{ "<!-- topics -->" | safeHTML }}
<div class="container">
<div class="row justify-content-center">
<div class="col-12 text-center">
Expand Down

0 comments on commit c31ac43

Please sign in to comment.