Fix menu paddings, add additional space for big screens

This commit is contained in:
Alex Shpak 2018-10-08 20:56:06 +02:00
parent 5b7db23aaa
commit 5b4dec6db9
5 changed files with 37 additions and 14 deletions

View file

@ -5,8 +5,9 @@ $block-border-radius: 0.15rem;
.markdown { .markdown {
line-height: 1.7; line-height: 1.7;
:first-child { > :first-child {
margin-top: 0; margin-top: 0;
line-height: 1em;
} }
h1, h2, h3, h4, h5 { h1, h2, h3, h4, h5 {

View file

@ -36,14 +36,20 @@ a {
} }
} }
img {
vertical-align: middle;
}
aside { aside {
ul { ul {
margin: 0; margin: 0;
padding-left: $padding-16; padding-left: $padding-16;
list-style: none; list-style: none;
line-height: 2em; line-height: 1.5em;
li { li {
margin: .5em 0;
a { display: block; } a { display: block; }
a:hover { opacity: .5; } a:hover { opacity: .5; }
@ -66,6 +72,15 @@ aside.fixed nav {
overflow: hidden auto; overflow: hidden auto;
} }
header {
display: flex;
align-items:center;
justify-content: space-between;
margin-bottom: $padding-16;
display: none;
}
main { main {
max-width: $content-max-width; max-width: $content-max-width;
margin: 0 auto; margin: 0 auto;
@ -96,22 +111,13 @@ main {
a { color: $nav-link-color; } a { color: $nav-link-color; }
a.active { color: $color-link; } a.active { color: $color-link; }
.flat { .flat-section {
margin-bottom: $padding-16; margin-bottom: $padding-16;
> a { font-weight: 700; } > a { font-weight: 700; }
> ul { padding-left: 0; } > ul { padding-left: 0; }
} }
} }
header {
display: flex;
align-items:center;
justify-content: space-between;
margin-bottom: $padding-16;
display: none;
}
.content { .content {
flex: 1 0; flex: 1 0;
width: 0; width: 0;
@ -167,3 +173,16 @@ $toc-hide-point: $menu-hide-point + $nav-menu-width;
} }
} }
} }
// Extra space for big screens
@media screen and (min-width: $toc-hide-point) {
main {
.content {
padding: $padding-16 * 2 $padding-16;
}
.menu nav, .toc nav {
padding: $padding-16 * 2;
}
}
}

1
exampleSite/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
resources/

View file

@ -1,6 +1,8 @@
# hugo server --themesDir ...
baseURL: http://example.org baseURL: http://example.org
title: Rx Jersey title: Rx Jersey
theme: book theme: hugo-book
# Book configuration # Book configuration
disablePathToLower: true disablePathToLower: true

View file

@ -8,7 +8,7 @@
{{ define "book-section" }} <!-- Single section of menu (recursive) --> {{ define "book-section" }} <!-- Single section of menu (recursive) -->
<ul> <ul>
{{ range .Section.Sections }} {{ range .Section.Sections }}
<li {{- if .Params.bookflatsection}} class="flat" {{ end }}> <li {{- if .Params.bookflatsection}} class="flat-section" {{ end }}>
{{- if .Content -}} {{- if .Content -}}
{{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }} {{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
{{- else -}} {{- else -}}