|
| 1 | +@charset "UTF-8"; |
| 2 | +// The customizable varibles can be found here: |
| 3 | +// https://github.com/JuliaDocs/Documenter.jl/tree/master/assets/html/scss |
| 4 | +// under documenter/_variables or documenter/_overrides. But some stuff are Bulma defaults |
| 5 | +// as well, so you may need to look them up too: https://bulma.io/documentation/customize/variables/ |
| 6 | + |
| 7 | + |
| 8 | +//////////////////////////////////////////////////////////////////////// |
| 9 | +//////////////////////////////////////////////////////////////////////// |
| 10 | +// Thse define the template: |
| 11 | +$maincolor: rgb(78, 134, 151); // main color of the org theme |
| 12 | +$secondcolor: rgb(197, 96, 255); // secondary color that serves as accents |
| 13 | + // it is used as-is for links in light theme |
| 14 | +$mainwhite: #fff; // color representing white |
| 15 | +$mainblack: #202020; // color representing black |
| 16 | +$darkbg: #1e1e20; // dark theme main page background |
| 17 | + |
| 18 | +// These commands set up the fonts for the main text and code blocks. |
| 19 | +// the fonts must be included into the assets of the `makdocs` command, with e.g. |
| 20 | +// format = Documenter.HTML( |
| 21 | +// prettyurls = CI, |
| 22 | +// assets = [ |
| 23 | +// "assets/logo.ico", |
| 24 | +// asset("https://fonts.googleapis.com/css?family=Montserrat|Source+Code+Pro&display=swap", class=:css), |
| 25 | +// ], |
| 26 | +// ), |
| 27 | +$family-sans-serif: 'Montserrat', sans-serif; |
| 28 | +$family-monospace: 'Source Code Pro', monospace; |
| 29 | +//////////////////////////////////////////////////////////////////////// |
| 30 | +//////////////////////////////////////////////////////////////////////// |
| 31 | + |
| 32 | +// variables controlling the siderbar's shadow |
| 33 | +$shadow-color: #bbb !default; |
| 34 | +$shadow-size: 0.2rem !default; |
| 35 | +$shadow-blur: 0.4rem !default; |
| 36 | + |
| 37 | +// Two cool helper functions: |
| 38 | +$lightness-unit: 8% !default; |
| 39 | +// Uses adjust-color to create a darker version of $color |
| 40 | +@function darken-color($color, $factor) { |
| 41 | + @return adjust-color($color, $lightness: -$factor*$lightness-unit); |
| 42 | +} |
| 43 | +// Uses adjust-color to create a lighter version of $color |
| 44 | +@function lighten-color($color, $factor) { |
| 45 | + @return adjust-color($color, $lightness: $factor*$lightness-unit); |
| 46 | +} |
| 47 | +// This template file overrides some of the Documenter theme variables to customize the theme: |
| 48 | +$themename: "documenter-dark"; // CSS file must be called `$(themename).css` |
| 49 | +// Instruct documenter/*.scss files that this is a dark theme |
| 50 | +$documenter-is-dark-theme: true; |
| 51 | + |
| 52 | +$boldcolor: lighten-color($maincolor, 4.5); |
| 53 | + |
| 54 | +$body-background-color: $darkbg; // main page background |
| 55 | + |
| 56 | +// this is the color the links get, and also when they are hovered |
| 57 | +$link: lighten-color($secondcolor, 2); |
| 58 | +$link-hover: lighten-color($link, 3); |
| 59 | + |
| 60 | +// Main text color: |
| 61 | +$text: darken-color($mainwhite, 0.2); |
| 62 | +// Bold text color, also affects headers |
| 63 | +$text-strong: $boldcolor; |
| 64 | + |
| 65 | +// Code text color: |
| 66 | +$code: #fff; |
| 67 | +//$code-background: rgba(0.5,0,0, 0.05); |
| 68 | +$codebg: darken-color($maincolor, 3); |
| 69 | +$code-background: $codebg; // for inline code |
| 70 | +$pre-background: $codebg; // for code blocks |
| 71 | +$documenter-docstring-header-background: lighten-color($body-background-color, 0.5); |
| 72 | + |
| 73 | +// Sidebar |
| 74 | +$documenter-sidebar-background: darken-color($maincolor, 1.2); //background color for sidebar |
| 75 | +$documenter-sidebar-color: $text; //font color for sidebar |
| 76 | +$documenter-sidebar-menu-hover-color: $documenter-sidebar-color; |
| 77 | +$documenter-sidebar-menu-hover-background: darken-color($documenter-sidebar-background, 1.2); |
| 78 | + |
| 79 | +$documenter-sidebar-menu-active-background: $darkbg; |
| 80 | +$documenter-sidebar-menu-active-color: $mainwhite; |
| 81 | +$documenter-sidebar-menu-active-hover-background: darken-color($documenter-sidebar-background, 1); |
| 82 | +$documenter-sidebar-menu-active-hover-color: $documenter-sidebar-menu-active-color; |
| 83 | +// these two change what happens with input boxes (the search box): |
| 84 | +$input-hover-border-color: $secondcolor; |
| 85 | +$input-focus-border-color: $mainwhite; |
| 86 | + |
| 87 | +$documenter-docstring-shadow: 3px 3px 4px invert($shadow-color); |
| 88 | + |
| 89 | +// Admonition stuff |
| 90 | +$admbg: lighten-color($body-background-color, 0.5); |
| 91 | +$admonition-background: ( |
| 92 | + 'default': $admbg, 'info': $admbg, 'success': $admbg, 'warning': $admbg, |
| 93 | + 'danger': $admbg, 'compat': $admbg |
| 94 | +); |
| 95 | +$admonition-header-background: ( |
| 96 | + 'default': #ba3f1f, 'warning': #a88b17, 'danger': #c7524c, |
| 97 | + 'success': #42ac68, 'info': #28c); |
| 98 | + |
| 99 | +// All secondary themes have to be nested in a theme--$(themename) class. When Documenter |
| 100 | +// switches themes, it applies this class to <html> and then disables the primary |
| 101 | +// stylesheet. |
| 102 | +@import "documenter/utilities"; |
| 103 | +@import "documenter/variables"; |
| 104 | +@import "bulma/utilities/all"; |
| 105 | +@import "bulma/base/minireset.sass"; |
| 106 | +@import "bulma/base/helpers.sass"; |
| 107 | + |
| 108 | +html.theme--#{$themename} { |
| 109 | + @import "bulma/base/generic.sass"; |
| 110 | + |
| 111 | + @import "documenter/overrides"; |
| 112 | + |
| 113 | + @import "bulma/elements/all"; |
| 114 | + @import "bulma/form/all"; |
| 115 | + @import "bulma/components/all"; |
| 116 | + @import "bulma/grid/all"; |
| 117 | + @import "bulma/layout/all"; |
| 118 | + |
| 119 | + // Additional overrides, if need be |
| 120 | + |
| 121 | + @import "documenter/elements"; |
| 122 | + @import "documenter/components/all"; |
| 123 | + @import "documenter/patches"; |
| 124 | + @import "documenter/layout/all"; |
| 125 | + |
| 126 | + @import "documenter/theme_overrides"; |
| 127 | + |
| 128 | + // $shadow-color: #202224; |
| 129 | + |
| 130 | + #documenter .docs-sidebar { // This makes sidebar have shadow at all displays |
| 131 | + border-right: none; |
| 132 | + box-shadow: 1.2*$shadow-size 0rem 1*$shadow-blur invert($shadow-color); |
| 133 | + |
| 134 | + form.docs-search > input { // these controls are for the searchbar |
| 135 | + color: $mainwhite; |
| 136 | + background-color: darken-color($documenter-sidebar-background, 1); |
| 137 | + border-color: darken-color($documenter-sidebar-background, 2); |
| 138 | + margin-top: 1.0rem; |
| 139 | + margin-bottom: 1.0rem; // adjust the margings between search and other elements |
| 140 | + &::placeholder { |
| 141 | + color: $mainwhite; // placeholder text color ("Search here...") |
| 142 | + } |
| 143 | + } |
| 144 | + } |
| 145 | + // FIXME: Hack to get a proper theme for highlight.js in the dark theme |
| 146 | + @import "highlightjs/a11y-dark"; |
| 147 | + // Also, a11y-dark does not highlight string interpolation properly. |
| 148 | + .hljs-subst { |
| 149 | + color: #f8f8f2; |
| 150 | + } |
| 151 | +} |
0 commit comments