diff --git a/book.toml b/book.toml index e25746ca..eb143c1a 100644 --- a/book.toml +++ b/book.toml @@ -10,9 +10,11 @@ build-dir = "public" create-missing = true [output.html] -git-repository-url = "https://gitlab.com/famedly/conduit" edit-url-template = "https://gitlab.com/famedly/conduit/-/edit/next/{path}" git-repository-icon = "fa-git-square" +default-theme="light" +preferred-dark-theme="light" +additional-css = ["theme/overrides.css"] [output.html.search] limit-results = 15 diff --git a/theme/index.hbs b/theme/index.hbs new file mode 100644 index 00000000..8b7a381f --- /dev/null +++ b/theme/index.hbs @@ -0,0 +1,356 @@ + + + + + + {{ title }} + {{#if is_print }} + + {{/if}} + {{#if base_url}} + + {{/if}} + + + + {{> head}} + + + + + + {{#if favicon_svg}} + + {{/if}} + {{#if favicon_png}} + + {{/if}} + + + + {{#if print_enable}} + + {{/if}} + + + + {{#if copy_fonts}} + + {{/if}} + + + + + + + + {{#each additional_css}} + + {{/each}} + + + + {{#if mathjax_support}} + + + {{/if}} + + + +
+ + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ {{> header}} + + + + {{#if search_enabled}} + + {{/if}} + + + + +
+
+ {{{ content }}} +
+ + +
+
+ + + +
+ + {{#if live_reload_endpoint}} + + + {{/if}} + + {{#if google_analytics}} + + + {{/if}} + + {{#if playground_line_numbers}} + + {{/if}} + + {{#if playground_copyable}} + + {{/if}} + + {{#if playground_js}} + + + + + + {{/if}} + + {{#if search_js}} + + + + {{/if}} + + + + + + + {{#each additional_js}} + + {{/each}} + + {{#if is_print}} + {{#if mathjax_support}} + + {{else}} + + {{/if}} + {{/if}} + +
+ + diff --git a/theme/overrides.css b/theme/overrides.css new file mode 100644 index 00000000..71d9767f --- /dev/null +++ b/theme/overrides.css @@ -0,0 +1,138 @@ +/* Styles copied from Conduit site */ +:root { + --content-max-width: 1000px; + --primary-color: #01274f; + --secondary-color: #fcfaff; + --primary-text-color: #f4f6f1; + --sidebar-bg: #FFF; +} + +body { + font-family: "Fira Sans", sans-serif; + font-size: 18px; + letter-spacing: 0.2px; + line-height: 26px; +} + +.main-header { + align-items: center; + box-sizing: border-box; + color: #000; + display: flex; + height: 100px; + justify-content: space-between; + padding: 20px 50px; + background-color: var(--primary-color); + position: sticky; +} + +.logo { + font-family: "Alfa Slab One", serif; + font-size: 32px; + color: var(--primary-text-color); + display: flex; + align-items: center; + margin: 0 40px; +} +.logo img { + width: 60px; + margin: 0 25px; +} + +.subtitle-text, +a.subtitle-text { + font-size: 20px; + font-weight: 500; + color: var(--primary-text-color); +} + +a.nav-item { + margin: 0 10px; + text-decoration: none; + font-size: 18px; + font-weight: bold; +} +.nav-item:hover { + color: #fff; + text-decoration: underline; +} + +@media screen and (max-width: 768px) { + .main-header { + padding: 10px 30px; + flex-direction: column; + align-items: center; + justify-content: center; + } + .logo { + font-size:28px; + margin: 10px; + } + .logo img { + width: 45px; + margin: 0 10px 0 0 + } + .nav-item, a.nav-item { + margin: 0 5px; + font-size: 14px + } + } + +/* ------------------------------------ */ +/* Overrides for default mdbook styling */ +.page-wrapper, .sidebar, #body-container, #menu-bar { + background-color: var(--secondary-color); +} + +#body-container { + display: flex; + justify-content: center; +} + +.main-header > a { + text-decoration: none; +} + +.sidebar { + align-self: flex-start; + flex-shrink: 0; + position: sticky; + top: 1rem; +} + +.sidebar .sidebar-scrollbox { + background-color: var(--sidebar-bg); + border-radius: 3px; + border-top: 5px solid var(--primary-color); + margin-left: 4rem; + margin-top: 2rem; + position: static; +} + +.js .sidebar .sidebar-resize-handle { + display: none; +} + +#sidebar-toggle-anchor:checked ~ .page-wrapper { + margin-inline-start: 2rem; + transform: none; +} + +.menu-bar { + justify-content: space-between; +} + +/* Things to hide in mdbook top bar */ +#theme-toggle, .menu-title, #sidebar-toggle { + display: none; +} + +/* Basic mobile support */ +@media only screen and (max-width: 768px) { + #body-container { + flex-direction: column; + } + .sidebar { + position: static; + } +}