mirror of
https://github.com/trwnh/hugo-theme-paradox.git
synced 2024-12-25 23:58:47 +00:00
fix up layout responsiveness for wide widths
This commit is contained in:
parent
3f1d03e4c5
commit
03b0e7e34d
20 changed files with 740 additions and 538 deletions
45
assets/styles/common/base.scss
Normal file
45
assets/styles/common/base.scss
Normal file
|
@ -0,0 +1,45 @@
|
|||
$site-max-width: 80rem;
|
||||
|
||||
:root {
|
||||
--site-max-width: #{$site-max-width};
|
||||
--nav-height: 4rem;
|
||||
--header-height: 4.5rem;
|
||||
--footer-height: 3rem;
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||
scroll-behavior: smooth;
|
||||
background: var(--ui-background);
|
||||
color: var(--ui-text);
|
||||
}
|
||||
|
||||
/* Single column layout, where main content stretches to fill. */
|
||||
body {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
min-height: calc(var(--vh, 1vh) * 100);
|
||||
max-width: 100vw;
|
||||
margin: auto;
|
||||
}
|
||||
main {flex-grow: 1;}
|
||||
|
||||
/*
|
||||
Sections are primary block units, usually of type <section>.
|
||||
Containers are an immediate child <div>, purely for constraining width.
|
||||
*/
|
||||
.section {
|
||||
padding: 2em 0; /* we apply a vertical padding only to sections */
|
||||
}
|
||||
.container {
|
||||
width: 100%;
|
||||
max-width: var(--site-max-width);
|
||||
margin: 0 auto;
|
||||
padding: 0 1em; /* and we apply a horizontal padding only to containers */
|
||||
}
|
||||
|
||||
/* Ensure consistent colors for text selection */
|
||||
::selection {
|
||||
background: var(--primary-accent);
|
||||
color: var(--primary-accent-text);
|
||||
}
|
35
assets/styles/common/colors.scss
Normal file
35
assets/styles/common/colors.scss
Normal file
|
@ -0,0 +1,35 @@
|
|||
:root {
|
||||
--link-color: #3371cf;
|
||||
--link-visited: #594288;
|
||||
|
||||
--primary-accent: rgb(0, 123, 255);
|
||||
--primary-accent-transparent: rgba(0, 123, 255,0.25);
|
||||
--primary-accent-text: #fff;
|
||||
|
||||
--ui-background: #fff;
|
||||
--ui-text: #111;
|
||||
--ui-text-muted: #666;
|
||||
--ui-text-bold: #000;
|
||||
|
||||
--ui-overlay: #ddd;
|
||||
--ui-overlay-text: var(--ui-text);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--link-color: #8fb1df;
|
||||
--link-visited: #a089d4;
|
||||
|
||||
--primary-accent: rgb(0, 123, 255);
|
||||
--primary-accent-transparent: rgba(64, 156, 255, 0.45);
|
||||
--primary-accent-text: #fff;
|
||||
|
||||
--ui-background: #212121;
|
||||
--ui-text: #eee;
|
||||
--ui-text-muted: #999;
|
||||
--ui-text-bold: #fff;
|
||||
|
||||
--ui-overlay: #333;
|
||||
--ui-overlay-text: var(--ui-text);
|
||||
}
|
||||
}
|
0
assets/styles/common/mixins.scss
Normal file
0
assets/styles/common/mixins.scss
Normal file
182
assets/styles/common/page.scss
Normal file
182
assets/styles/common/page.scss
Normal file
|
@ -0,0 +1,182 @@
|
|||
.page {
|
||||
/* text */
|
||||
h1 {font-size: 1.8em}
|
||||
h2 {font-size: 1.6em}
|
||||
h3 {font-size: 1.423em}
|
||||
h4 {font-size: 1.265em}
|
||||
h5 {font-size: 1.125em}
|
||||
h6 {font-size: 1em}
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
line-height: 1.2;
|
||||
margin-bottom: 1rem;
|
||||
margin-top: 2rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
p {
|
||||
line-height: 2;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
a {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
/* semantics */
|
||||
em {font-style: italic}
|
||||
strong {font-weight: 700}
|
||||
/* text formatting */
|
||||
--script-size: 0.65em;
|
||||
sup {
|
||||
position: relative;
|
||||
font-size: var(--script-size);
|
||||
top: -1em;
|
||||
}
|
||||
sub {
|
||||
position: relative;
|
||||
font-size: var(--script-size);
|
||||
}
|
||||
@supports #{'selector\(:has(kbd))'} {
|
||||
/* style individual keys only (for the innermost <kbd> element) */
|
||||
kbd kbd,
|
||||
kbd:not(:has(kbd)) {
|
||||
font-family: monospace;
|
||||
padding: 0.25em;
|
||||
background: var(--ui-overlay);
|
||||
color: var(--ui-overlay-text);
|
||||
}
|
||||
}
|
||||
@supports not #{'selector\(:has(kbd))'} {
|
||||
/* style the entire key sequence */
|
||||
kbd {
|
||||
font-family: monospace;
|
||||
padding: 0.25em;
|
||||
background: var(--ui-overlay);
|
||||
color: var(--ui-overlay-text);
|
||||
}
|
||||
/* and prevent double-styling for nested keys */
|
||||
kbd kbd {
|
||||
background: none;
|
||||
}
|
||||
}
|
||||
mark {
|
||||
background: var(--primary-accent-transparent);
|
||||
color: var(--ui-text);
|
||||
--pad-x-highlight: 0.125em;
|
||||
padding-left: var(--pad-x-highlight);
|
||||
padding-right: var(--pad-x-highlight);
|
||||
}
|
||||
abbr[title]:after {
|
||||
content: '?';
|
||||
font-size: var(--script-size);
|
||||
color: var(--ui-text-muted);
|
||||
}
|
||||
/* lists */
|
||||
ul {list-style: disc; margin: 1em 0;}
|
||||
li {margin-bottom: 1em; line-height: 1.4; margin-left: 1em;}
|
||||
ol {list-style: decimal; margin: 1em 0;}
|
||||
dl {margin: 1em 0; line-height: 1.4;}
|
||||
dt {font-weight: 700;}
|
||||
dd {margin-left: 1em;}
|
||||
/* block elements */
|
||||
img {
|
||||
width: 100%;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
blockquote {
|
||||
font-style: italic;
|
||||
font-size: 1em;
|
||||
margin: 1em 0;
|
||||
border-left: 0.25rem solid var(--ui-text-bold);
|
||||
padding-left: 0.75em;
|
||||
line-height: 1.4;
|
||||
}
|
||||
pre {
|
||||
font-family: monospace;
|
||||
background: #333;
|
||||
color: white;
|
||||
padding: 1em;
|
||||
line-height: 1.4;
|
||||
overflow-x: scroll;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
code {
|
||||
font-family: monospace;
|
||||
}
|
||||
/* figures */
|
||||
figure {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
figure img {
|
||||
width: 100%;
|
||||
margin-bottom: -0.125em;
|
||||
}
|
||||
figcaption {
|
||||
background: #212121;
|
||||
color: white;
|
||||
font-style: italic;
|
||||
padding: 1em;
|
||||
font-size: 0.8em;
|
||||
line-height: 1.2;
|
||||
}
|
||||
/* tables */
|
||||
table {text-align: center;}
|
||||
thead {font-weight: 700;}
|
||||
th, td {
|
||||
border: 1px solid black;
|
||||
padding: 0.5em;
|
||||
}
|
||||
/* {{<hint>}} shortcode */
|
||||
.hint {
|
||||
padding: 1em;
|
||||
line-height: 2;
|
||||
}
|
||||
.hint,
|
||||
.hint.info,
|
||||
.hint.tip {
|
||||
background: rgba(142, 226, 142, 0.2);
|
||||
border-left: 4px solid rgb(142, 226, 142);
|
||||
}
|
||||
|
||||
.hint.warning {
|
||||
background: rgba(218, 226, 142, 0.2);
|
||||
border-left: 4px solid rgb(218, 226, 142);
|
||||
}
|
||||
|
||||
.hint.danger {
|
||||
background: rgba(226, 142, 142, 0.2);
|
||||
border-left: 4px solid rgb(226, 142, 142);
|
||||
}
|
||||
/* hugo-specific citation footnote */
|
||||
cite sup {
|
||||
position: inherit;
|
||||
font-size: inherit;
|
||||
a {
|
||||
padding: 0.25em;
|
||||
}
|
||||
&:before {
|
||||
content: ' [';
|
||||
}
|
||||
&:after {
|
||||
content: ']';
|
||||
}
|
||||
}
|
||||
/* toc */
|
||||
.toc-title {
|
||||
margin-bottom: 0.5em;
|
||||
font-weight: 900;
|
||||
text-transform: uppercase;
|
||||
color: var(--ui-text-muted);
|
||||
}
|
||||
#TableOfContents {
|
||||
ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
}
|
||||
li {
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
li > ul { /* indent subheadings */
|
||||
margin: 0;
|
||||
margin-left: 1em;
|
||||
}
|
||||
}
|
||||
}
|
44
assets/styles/common/reset.scss
Normal file
44
assets/styles/common/reset.scss
Normal file
|
@ -0,0 +1,44 @@
|
|||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
b, u, i, center,
|
||||
dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td,
|
||||
article, aside, canvas, details, embed,
|
||||
figure, figcaption, footer, header, hgroup,
|
||||
menu, nav, output, ruby, section, summary,
|
||||
time, mark, audio, video {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
font-size: 100%;
|
||||
font: inherit;
|
||||
vertical-align: baseline;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
article, aside, details, figcaption, figure,
|
||||
footer, header, hgroup, menu, nav, section {
|
||||
display: block;
|
||||
}
|
||||
body {
|
||||
line-height: 1;
|
||||
}
|
||||
ol, ul {
|
||||
list-style: none;
|
||||
}
|
||||
blockquote, q {
|
||||
quotes: none;
|
||||
}
|
||||
blockquote:before, blockquote:after,
|
||||
q:before, q:after {
|
||||
content: '';
|
||||
content: none;
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
56
assets/styles/components/docs-menu.scss
Normal file
56
assets/styles/components/docs-menu.scss
Normal file
|
@ -0,0 +1,56 @@
|
|||
/* navigation menu toggle */
|
||||
|
||||
.toggle-menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.toggle-menu:not(:checked) ~ .menu {
|
||||
display: none;
|
||||
}
|
||||
.toggle-menu__label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-weight: 900;
|
||||
gap: 0.25rem;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
/* navigation menu */
|
||||
|
||||
.docs-nav {
|
||||
padding: 1em 0;
|
||||
.menu {
|
||||
margin-top: 1em;
|
||||
> li {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
}
|
||||
li {line-height: 2}
|
||||
.sub-menu {
|
||||
margin-left: 1em;
|
||||
li::marker {
|
||||
content: '⟣ ';
|
||||
}
|
||||
.sub-menu li::marker {
|
||||
content: '↳ ';
|
||||
}
|
||||
}
|
||||
.section-title > a {
|
||||
font-weight: 700;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
/* top of menu link should show only when focused */
|
||||
|
||||
#menu {margin-bottom: 1em;}
|
||||
#menu:not(:focus) {
|
||||
clip: rect(0 0 0 0);
|
||||
clip-path: inset(50%);
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
white-space: nowrap;
|
||||
width: 1px;
|
||||
}
|
5
assets/styles/components/header-menu.scss
Normal file
5
assets/styles/components/header-menu.scss
Normal file
|
@ -0,0 +1,5 @@
|
|||
.header-nav {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
justify-content: center;
|
||||
}
|
11
assets/styles/components/site-footer.scss
Normal file
11
assets/styles/components/site-footer.scss
Normal file
|
@ -0,0 +1,11 @@
|
|||
.site-footer {
|
||||
height: var(--footer-height);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.site-footer hr {display: none;}
|
||||
.site-footer .container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.breadcrumbs {display: flex; flex-flow: row wrap;}
|
33
assets/styles/components/site-header.scss
Normal file
33
assets/styles/components/site-header.scss
Normal file
|
@ -0,0 +1,33 @@
|
|||
.site-masthead {
|
||||
display: inline-flex;
|
||||
flex-flow: row;
|
||||
align-items: center;
|
||||
gap: 1em;
|
||||
padding: 4px;
|
||||
}
|
||||
.site-icon {
|
||||
height: 2em;
|
||||
}
|
||||
.site-title {
|
||||
font-weight: 900;
|
||||
letter-spacing: -0.5px;
|
||||
font-size: 1.25em;
|
||||
}
|
||||
.site-masthead, .site-masthead:visited {
|
||||
color: inherit
|
||||
}
|
||||
|
||||
.site-masthead:focus {
|
||||
color: var(--primary-accent-text);
|
||||
}
|
||||
|
||||
.site-header {padding: 1em 0;}
|
||||
|
||||
.site-header a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.site-header .container {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
justify-content: space-between;
|
||||
}
|
24
assets/styles/print.scss
Normal file
24
assets/styles/print.scss
Normal file
|
@ -0,0 +1,24 @@
|
|||
@import "common/reset";
|
||||
@import "common/colors";
|
||||
@import "common/base";
|
||||
@import "common/page";
|
||||
|
||||
@import "components/site-header";
|
||||
|
||||
.header-nav,
|
||||
.docs-nav,
|
||||
.site-footer,
|
||||
.edit-on-github,
|
||||
.footnote-backref
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
.page-header {padding: 0;}
|
||||
|
||||
.page abbr[title]::after {
|
||||
content: " (" attr(title) ") ";
|
||||
}
|
||||
|
||||
a[href^="http"]:after {
|
||||
content: " (" attr(href) ") ";
|
||||
}
|
12
assets/styles/screen.scss
Normal file
12
assets/styles/screen.scss
Normal file
|
@ -0,0 +1,12 @@
|
|||
@import "common/reset";
|
||||
@import "common/colors";
|
||||
@import "common/base";
|
||||
@import "common/page";
|
||||
|
||||
@import "components/site-header";
|
||||
@import "components/header-menu";
|
||||
@import "components/docs-menu";
|
||||
@import "components/site-footer";
|
||||
|
||||
@import "screen/layout";
|
||||
@import "screen/links";
|
173
assets/styles/screen/layout.scss
Normal file
173
assets/styles/screen/layout.scss
Normal file
|
@ -0,0 +1,173 @@
|
|||
/* single layout */
|
||||
|
||||
.page {
|
||||
.page-title {margin-top: 0;}
|
||||
.lastmod {
|
||||
margin-top: 1em;
|
||||
color: var(--ui-text-muted)
|
||||
}
|
||||
.language-list {
|
||||
display: flex;
|
||||
flex-flow: wrap;
|
||||
list-style: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* [responsive] re-show the navigation menu as a sidebar */
|
||||
|
||||
@media (min-width: 60rem) {
|
||||
body {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 3fr;
|
||||
height: calc(100 * var(--vh, 1vh));
|
||||
}
|
||||
.site-header, .scroll-margin, .site-footer {
|
||||
grid-column: span 2
|
||||
}
|
||||
.docs-nav {
|
||||
grid-column: 1;
|
||||
height: calc(100 * var(--vh, 1vh) - var(--header-height) - var(--footer-height));
|
||||
overflow-y: auto;
|
||||
padding: 0;
|
||||
}
|
||||
main {
|
||||
grid-column: 2;
|
||||
height: calc(100 * var(--vh, 1vh) - var(--header-height) - var(--footer-height));
|
||||
overflow-y: auto;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.docs-nav::-webkit-scrollbar,
|
||||
main::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.docs-nav .menu {margin-top: 0;}
|
||||
|
||||
.page-header {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* toggle is no longer needed */
|
||||
|
||||
.toggle-menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.toggle-menu:not(:checked) ~ .menu {
|
||||
display: unset;
|
||||
}
|
||||
.toggle-menu__label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* [responsive] move the toc to its own column */
|
||||
|
||||
@media (min-width: 75rem) {
|
||||
body {
|
||||
grid-template-columns: 20rem 1fr;
|
||||
}
|
||||
.page {
|
||||
display: grid;
|
||||
grid-template-columns: 40rem 1fr;
|
||||
}
|
||||
.page .page-header {
|
||||
grid-column: span 2
|
||||
}
|
||||
.page .section {
|
||||
grid-column: 1;
|
||||
}
|
||||
.page .toc {
|
||||
grid-column: 2;
|
||||
grid-row: span 2;
|
||||
padding: 0;
|
||||
}
|
||||
.page .toc .container {
|
||||
width: 15rem;
|
||||
margin: 0;
|
||||
position: fixed;
|
||||
top: var(--header-height);
|
||||
max-height: calc(100vh - var(--header-height) - var(--footer-height));
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
|
||||
/* [responsive] let the <main> expand until max width of site */
|
||||
|
||||
@media (min-width: 80rem) {
|
||||
|
||||
.page {
|
||||
grid-template-columns: 1fr 20rem; /* toc now visually balanced with menu */
|
||||
}
|
||||
|
||||
/* start limiting content since it can exceed 80ch now */
|
||||
|
||||
.page .content .container {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(80ch, 1fr) minmax(0, 1fr);
|
||||
> * {
|
||||
grid-column: 2;
|
||||
}
|
||||
> img
|
||||
{
|
||||
grid-column: 1 / span 3;
|
||||
}
|
||||
}
|
||||
|
||||
/* also make the page header line up */
|
||||
|
||||
.page .page-header {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(80ch, 1fr) minmax(0, 1fr);
|
||||
> .container {
|
||||
grid-column: 2;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* [responsive] <main> has reached maxwidth */
|
||||
|
||||
@media (min-width: $site-max-width + 40rem) {
|
||||
|
||||
/* we need to grow equally now */
|
||||
|
||||
body {
|
||||
grid-template-columns: 1fr var(--site-max-width, $site-max-width) 1fr;
|
||||
}
|
||||
|
||||
.site-header,
|
||||
.scroll-margin,
|
||||
.site-footer
|
||||
{
|
||||
grid-column: 2
|
||||
}
|
||||
|
||||
/* the page and toc take their space */
|
||||
|
||||
main {grid-column: 2 / span 2;}
|
||||
|
||||
/* except now the page is fixed to maxwidth and the toc can "grow" */
|
||||
|
||||
.page {
|
||||
grid-template-columns: var(--site-max-width, $site-max-width) 1fr;
|
||||
}
|
||||
|
||||
/* we don't actually want it to grow, though! just stick to the side */
|
||||
|
||||
.page {position: relative;}
|
||||
.page .toc {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
/* also the menu sidebar should stick to the other side */
|
||||
.docs-nav {
|
||||
position: sticky;
|
||||
width: 20rem;
|
||||
place-self: end;
|
||||
}
|
||||
|
||||
}
|
29
assets/styles/screen/links.scss
Normal file
29
assets/styles/screen/links.scss
Normal file
|
@ -0,0 +1,29 @@
|
|||
a:link {
|
||||
transition: all 0.1s ease-out;
|
||||
color: var(--link-color);
|
||||
text-decoration-thickness: .0625rem;
|
||||
text-underline-offset: 0.125em;
|
||||
text-decoration-skip-ink: none;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: var(--link-visited);
|
||||
}
|
||||
|
||||
a:focus {
|
||||
outline: none;
|
||||
background: var(--primary-accent);
|
||||
color: var(--primary-accent-text);
|
||||
border-radius: 2px;
|
||||
text-decoration: none;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration-thickness: 0.125em;
|
||||
text-underline-offset: 0.25em;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion) {
|
||||
a:link {transition: none}
|
||||
}
|
|
@ -5,8 +5,21 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/style.screen.css" media="screen" />
|
||||
<script type="text/javascript" href="{{ .Site.BaseURL }}js/script.js"></script>
|
||||
{{ $screen := resources.Get "styles/screen.scss" | toCSS | minify | fingerprint }}
|
||||
<link rel="stylesheet"
|
||||
href="{{ $screen.Permalink }}"
|
||||
integrity="{{ $screen.Data.Integrity }}"
|
||||
media="screen" />
|
||||
{{ $print := resources.Get "styles/print.scss" | toCSS | minify | fingerprint }}
|
||||
<link rel="stylesheet"
|
||||
href="{{ $print.Permalink }}"
|
||||
integrity="{{ $print.Data.Integrity }}"
|
||||
media="print" />
|
||||
{{ $script := resources.Get "scripts/main.js" | js.Build "script.js" | minify | fingerprint }}
|
||||
<script type="text/javascript"
|
||||
src="{{ $script.Permalink }}"
|
||||
integrity="{{ $script.Data.Integrity }}">
|
||||
</script>
|
||||
{{ partial "seo.html" . }}
|
||||
{{ block "head" . }}
|
||||
{{ end }}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
<header class="section page-header">
|
||||
<div class="container">
|
||||
<h1 class="page-title">{{ .Title }}</h1>
|
||||
<p class="page-summary">{{.Summary}}</p>
|
||||
<p class="lastmod">Last modified <datetime class="date"> {{ .Lastmod.Format "Mon Jan 2, 2006" }} </datetime> - <a href="{{.Site.Params.repo}}/edit/{{.Site.Params.branch}}/content/{{.File.Lang}}/{{.File.Path}}">Edit this page on Github</a></p>
|
||||
<p class="page-summary">{{.Page.Summary}}</p>
|
||||
<p class="lastmod">Last modified <datetime class="date">{{ .Lastmod.Format "Mon Jan 2, 2006" }}</datetime><span class="edit-on-github"> - <a href="{{.Site.Params.repo}}/edit/{{.Site.Params.branch}}/content/{{.File.Lang}}/{{.File.Path}}">Edit this page on Github</a></span></p>
|
||||
{{ partial "i18nlist.html" . }}
|
||||
</div>
|
||||
</header>
|
||||
|
|
|
@ -1,42 +1,69 @@
|
|||
<nav class="site-nav">
|
||||
<nav class="docs-nav">
|
||||
<div class="container">
|
||||
<input type="checkbox" class="toggle-menu" name="toggle" id="toggle">
|
||||
<label class="toggle-menu__label" for="toggle"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h7" />
|
||||
</svg> Menu</label>
|
||||
<label class="toggle-menu__label" for="toggle"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
|
||||
fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h7" />
|
||||
</svg> Menu</label>
|
||||
<ul class="menu">
|
||||
<a id="menu" href="#top">Skip menu</a>
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.docs }}
|
||||
{{ if .HasChildren}}
|
||||
<li class='section-title{{ if or ($currentPage.IsMenuCurrent "docs" .) (eq $currentPage.Section .Identifier) }} active{{ end }}'>
|
||||
<a href="{{ .URL | absLangURL }}">
|
||||
{{ if .HasChildren}}
|
||||
<li
|
||||
class='section-title{{ if or ($currentPage.IsMenuCurrent "docs" .) (eq $currentPage.Section .Identifier) }} active{{ end }}'>
|
||||
<a href="{{ .URL | absLangURL }}">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
{{ .Post }}
|
||||
</a>
|
||||
<ul class="sub-menu">
|
||||
{{ range .Children }}
|
||||
<li class='{{ if or ($currentPage.IsMenuCurrent "docs" .) (eq $currentPage.Section .Identifier) }}active{{ end }}'>
|
||||
<a href="{{ .URL | absLangURL }}">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
{{ .Post }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
{{ else }}
|
||||
<li class='{{ if or ($currentPage.IsMenuCurrent "docs" .) (eq $currentPage.Section .Identifier) }}active{{ end }}'>
|
||||
<a href="{{ .URL | absLangURL }}">
|
||||
</a>
|
||||
<ul class="sub-menu">
|
||||
{{ range .Children }}
|
||||
{{ if .HasChildren}}
|
||||
<li
|
||||
class='{{ if or ($currentPage.IsMenuCurrent "docs" .) (eq $currentPage.Section .Identifier) }} active{{ end }}'>
|
||||
<a href="{{ .URL | absLangURL }}">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
{{ .Post }}
|
||||
</a>
|
||||
</a>
|
||||
<ul class="sub-menu">
|
||||
{{ range .Children }}
|
||||
<li
|
||||
class='{{ if or ($currentPage.IsMenuCurrent "docs" .) (eq $currentPage.Section .Identifier) }}active{{ end }}'>
|
||||
<a href="{{ .URL | absLangURL }}">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
{{ .Post }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
{{ else }}
|
||||
<li
|
||||
class='{{ if or ($currentPage.IsMenuCurrent "docs" .) (eq $currentPage.Section .Identifier) }}active{{ end }}'>
|
||||
<a href="{{ .URL | absLangURL }}">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
{{ .Post }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
{{ else }}
|
||||
<li
|
||||
class='{{ if or ($currentPage.IsMenuCurrent "docs" .) (eq $currentPage.Section .Identifier) }}active{{ end }}'>
|
||||
<a href="{{ .URL | absLangURL }}">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
{{ .Post }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
19
layouts/partials/main-menu.html
Normal file
19
layouts/partials/main-menu.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
<nav class="header-nav">
|
||||
<div class="container">
|
||||
|
||||
<ul class="menu">
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.main }}
|
||||
<li
|
||||
class='{{ if or ($currentPage.IsMenuCurrent "main" .) (eq $currentPage.Section .Identifier) }}active{{ end }}'>
|
||||
<a href="{{ .URL | absLangURL }}">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
{{ .Post }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</nav>
|
|
@ -4,9 +4,10 @@
|
|||
<img class="site-icon" height="32" src="{{.Site.Params.icon}}">
|
||||
<p class="site-title">{{.Site.Params.title}}</p>
|
||||
</a>
|
||||
{{ partial "main-menu.html" . }}
|
||||
</div>
|
||||
</header>
|
||||
<div class="scroll-margin" style="position: relative;">
|
||||
<div id="top" style="scroll-margin-top: var(--header-height);"></div>
|
||||
</div>
|
||||
{{ partial "docs-menu.html" .}}
|
||||
{{ partial "docs-menu.html" . }}
|
|
@ -1,507 +0,0 @@
|
|||
/*==============================================================================
|
||||
Paradox - Hugo theme for simple, clean documentation
|
||||
with an opinionated feature set.
|
||||
|
||||
Table of contents:
|
||||
|
||||
0 - Reset
|
||||
1 - Base
|
||||
2 - Page content
|
||||
3 - Site structure
|
||||
==============================================================================*/
|
||||
|
||||
/*==============================================================================
|
||||
0 - Reset
|
||||
*/
|
||||
|
||||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
b, u, i, center,
|
||||
dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td,
|
||||
article, aside, canvas, details, embed,
|
||||
figure, figcaption, footer, header, hgroup,
|
||||
menu, nav, output, ruby, section, summary,
|
||||
time, mark, audio, video {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
font-size: 100%;
|
||||
font: inherit;
|
||||
vertical-align: baseline;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
article, aside, details, figcaption, figure,
|
||||
footer, header, hgroup, menu, nav, section {
|
||||
display: block;
|
||||
}
|
||||
body {
|
||||
line-height: 1;
|
||||
}
|
||||
ol, ul {
|
||||
list-style: none;
|
||||
}
|
||||
blockquote, q {
|
||||
quotes: none;
|
||||
}
|
||||
blockquote:before, blockquote:after,
|
||||
q:before, q:after {
|
||||
content: '';
|
||||
content: none;
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
/*==============================================================================
|
||||
1 - Base
|
||||
|
||||
This section contains foundational styles
|
||||
for the structure of the website.
|
||||
*/
|
||||
|
||||
:root {
|
||||
--container-width: 1280px;
|
||||
--nav-height: 4rem;
|
||||
--header-height: 4rem;
|
||||
--footer-height: 3rem;
|
||||
--link-color: #3371cf;
|
||||
--link-visited: #594288;
|
||||
--primary-accent: rgb(0, 123, 255);
|
||||
--primary-accent-transparent: rgba(0, 123, 255,0.25);
|
||||
--primary-accent-text: #fff;
|
||||
--ui-background: #fff;
|
||||
--ui-text: #111;
|
||||
--ui-text-muted: #666;
|
||||
--ui-text-bold: #000;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--link-color: #8fb1df;
|
||||
--link-visited: #a089d4;
|
||||
--primary-accent: rgb(0, 123, 255);
|
||||
--primary-accent-transparent: rgba(0, 123, 255,0.25);
|
||||
--primary-accent-text: #fff;
|
||||
--ui-background: #212121;
|
||||
--ui-text: #eee;
|
||||
--ui-text-muted: #999;
|
||||
--ui-text-bold: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||
scroll-behavior: smooth;
|
||||
background: var(--ui-background);
|
||||
color: var(--ui-text);
|
||||
}
|
||||
|
||||
/* Single column layout, where main content stretches to fill. */
|
||||
body {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
min-height: calc(var(--vh, 1vh) * 100);
|
||||
max-width: var(--container-width);
|
||||
margin: auto;
|
||||
}
|
||||
main {flex-grow: 1;}
|
||||
|
||||
/*
|
||||
Sections are primary block units, usually of type <section>.
|
||||
Containers are an immediate child <div>, purely for constraining width.
|
||||
*/
|
||||
.section {
|
||||
padding: 2em 0; /* we apply a vertical padding only to sections */
|
||||
}
|
||||
.container {
|
||||
width: 100%;
|
||||
max-width: var(--container-width);
|
||||
margin: 0 auto;
|
||||
padding: 0 1em; /* and we apply a horizontal padding only to containers */
|
||||
}
|
||||
|
||||
/*==============================================================================
|
||||
2 - Page content
|
||||
|
||||
This section contains foundational styles
|
||||
for a single web page's content.
|
||||
*/
|
||||
|
||||
.page h1 {font-size: 1.8em}
|
||||
.page h2 {font-size: 1.6em}
|
||||
.page h3 {font-size: 1.423em}
|
||||
.page h4 {font-size: 1.265em}
|
||||
.page h5 {font-size: 1.125em}
|
||||
.page h6 {font-size: 1em}
|
||||
|
||||
.page h1,
|
||||
.page h2,
|
||||
.page h3,
|
||||
.page h4,
|
||||
.page h5,
|
||||
.page h6 {
|
||||
line-height: 1.2;
|
||||
margin-bottom: 1rem;
|
||||
margin-top: 2rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
.page p {
|
||||
line-height: 2;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.page a {word-wrap: break-word;}
|
||||
.page blockquote {
|
||||
font-style: italic;
|
||||
font-size: 1em;
|
||||
margin: 1em 0;
|
||||
border-left: 0.25rem solid black;
|
||||
padding-left: 0.75em;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.page pre {
|
||||
font-family: monospace;
|
||||
background: #333;
|
||||
color: white;
|
||||
padding: 1em;
|
||||
line-height: 1.4;
|
||||
overflow-x: scroll;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
.page ul {list-style: disc; margin: 1em 0;}
|
||||
.page li {margin-bottom: 1em; line-height: 1.4; margin-left: 1em;}
|
||||
.page ol {list-style: decimal; margin: 1em 0;}
|
||||
.page dl {margin: 1em 0; line-height: 1.4;}
|
||||
.page dt {font-weight: 700;}
|
||||
.page dd {margin-left: 1em;}
|
||||
.page em {font-style: italic}
|
||||
.page strong {font-weight: 700}
|
||||
.page sup {
|
||||
position: relative;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
.page sup a {position: relative; top: -0.5em;}
|
||||
.page table {text-align: center;}
|
||||
.page thead {font-weight: 700;}
|
||||
.page th,
|
||||
.page td {
|
||||
border: 1px solid black;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
.page img {
|
||||
width: 100%;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.page figure {margin-bottom: 1em;}
|
||||
.page figure img {
|
||||
width: 100%;
|
||||
margin-bottom: -0.125em;
|
||||
}
|
||||
.page figcaption {
|
||||
background: #212121;
|
||||
color: white;
|
||||
font-style: italic;
|
||||
padding: 1em;
|
||||
font-size: 0.8em;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.page .hint {
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
/*==============================================================================
|
||||
3 - Site structure
|
||||
|
||||
This section contains styles
|
||||
for laying out the structural elements.
|
||||
*/
|
||||
|
||||
/* site header */
|
||||
.site-header {padding: 1em 0;}
|
||||
|
||||
.site-header a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.site-header .container {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.site-masthead {
|
||||
display: inline-flex;
|
||||
flex-flow: row;
|
||||
align-items: center;
|
||||
gap: 1em;
|
||||
}
|
||||
.site-icon {
|
||||
height: 2em;
|
||||
}
|
||||
.site-title {
|
||||
font-weight: 900;
|
||||
letter-spacing: -0.5px;
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
/* navigation menu */
|
||||
|
||||
.site-nav {
|
||||
padding: 1em 0;
|
||||
}
|
||||
.site-nav .menu {margin-top: 1em;}
|
||||
.site-nav .menu > li {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
#menu {margin-bottom: 1em;}
|
||||
#menu:not(:focus) {
|
||||
clip: rect(0 0 0 0);
|
||||
clip-path: inset(50%);
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
white-space: nowrap;
|
||||
width: 1px;
|
||||
}
|
||||
.site-nav .section-title > a {
|
||||
font-weight: 700;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
.site-nav li {line-height: 2}
|
||||
.site-nav .sub-menu {margin-left: 1em;}
|
||||
|
||||
/* navigation menu toggle */
|
||||
|
||||
.toggle-menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.toggle-menu:not(:checked) ~ .menu {
|
||||
display: none;
|
||||
}
|
||||
.toggle-menu__label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* page */
|
||||
|
||||
.page .content p {
|
||||
max-width: 80ch;
|
||||
}
|
||||
|
||||
/* footer */
|
||||
|
||||
.site-footer {
|
||||
height: var(--footer-height);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.site-footer hr {display: none;}
|
||||
.site-footer .container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.breadcrumbs {display: flex; flex-flow: row wrap;}
|
||||
|
||||
/*==============================================================================
|
||||
4 - Aesthetic
|
||||
|
||||
This section contains aesthetic styles
|
||||
such as typography and color.
|
||||
*/
|
||||
|
||||
a:link {
|
||||
transition: all 0.1s ease-out;
|
||||
color: var(--link-color);
|
||||
text-decoration-thickness: .0625rem;
|
||||
text-underline-offset: 0.125em;
|
||||
text-decoration-skip-ink: none;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: var(--link-visited);
|
||||
}
|
||||
|
||||
a:focus {
|
||||
outline: none;
|
||||
background: var(--primary-accent);
|
||||
color: var(--primary-accent-text);
|
||||
padding: 4px;
|
||||
border-radius: 2px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration-thickness: 0.125em;
|
||||
text-underline-offset: 0.25em;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion) {
|
||||
a:link {transition: none}
|
||||
}
|
||||
|
||||
.site-masthead, .site-masthead:visited {
|
||||
color: inherit
|
||||
}
|
||||
|
||||
.site-masthead:focus {
|
||||
color: var(--primary-accent-text);
|
||||
}
|
||||
|
||||
.toggle-menu__label {
|
||||
font-weight: 900;
|
||||
gap: 0.25rem;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.page .page-title {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.page .toc-title {
|
||||
margin-bottom: 0.5em;
|
||||
font-weight: 900;
|
||||
text-transform: uppercase;
|
||||
color: var(--ui-text-muted);
|
||||
}
|
||||
#TableOfContents ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
}
|
||||
#TableOfContents li {
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
#TableOfContents li > ul {
|
||||
margin: 0;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
.page blockquote {
|
||||
border-color: var(--ui-text-bold)
|
||||
}
|
||||
|
||||
.page code {
|
||||
font-family: monospace;
|
||||
padding: 4px;
|
||||
background: rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.page .hint {
|
||||
line-height: 2;
|
||||
}
|
||||
|
||||
.page .hint, .page .hint.info, .page .hint.tip {
|
||||
background: rgba(142, 226, 142, 0.2);
|
||||
border-left: 4px solid rgb(142, 226, 142);
|
||||
}
|
||||
|
||||
.page .hint.warning {
|
||||
background: rgba(218, 226, 142, 0.2);
|
||||
border-left: 4px solid rgb(218, 226, 142);
|
||||
}
|
||||
|
||||
.page .hint.danger {
|
||||
background: rgba(226, 142, 142, 0.2);
|
||||
border-left: 4px solid rgb(226, 142, 142);
|
||||
}
|
||||
|
||||
.page ul.language-list {
|
||||
display: flex;
|
||||
flex-flow: wrap;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.page .lastmod {
|
||||
margin-top: 1em;
|
||||
color: var(--ui-text-muted)
|
||||
}
|
||||
|
||||
/*==============================================================================
|
||||
5 - Responsive
|
||||
|
||||
This section contains responsive styles
|
||||
for wider screens.
|
||||
*/
|
||||
|
||||
@media (min-width: 60rem) {
|
||||
body {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 3fr;
|
||||
height: 100 * var(--vh, 1vh);
|
||||
}
|
||||
.site-header, .scroll-margin, .site-footer {
|
||||
grid-column: span 2
|
||||
}
|
||||
.site-nav {
|
||||
grid-column: 1;
|
||||
height: calc(100 * var(--vh, 1vh) - var(--header-height) - var(--footer-height));
|
||||
overflow-y: auto;
|
||||
scrollbar-width: none;
|
||||
padding: 0;
|
||||
}
|
||||
main {
|
||||
grid-column: 2;
|
||||
height: calc(100 * var(--vh, 1vh) - var(--header-height) - var(--footer-height));
|
||||
overflow-y: auto;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.site-nav::-webkit-scrollbar,
|
||||
main::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.site-nav .menu {margin-top: 0;}
|
||||
|
||||
.page-header {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* re-show the navigation menu as a sidebar */
|
||||
|
||||
.toggle-menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.toggle-menu:not(:checked) ~ .menu {
|
||||
display: unset;
|
||||
}
|
||||
.toggle-menu__label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media (min-width: 75rem) {
|
||||
body {
|
||||
grid-template-columns: 20rem 1fr;
|
||||
}
|
||||
.page {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 15rem;
|
||||
}
|
||||
.page .page-header {
|
||||
grid-column: span 2
|
||||
}
|
||||
.page .section {
|
||||
grid-column: 1;
|
||||
}
|
||||
.page .toc {
|
||||
grid-column: 2;
|
||||
position: relative;
|
||||
padding: 0;
|
||||
}
|
||||
.page .toc .container {
|
||||
position: fixed;
|
||||
width: 15rem;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue