diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..b15c6e6 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: doks # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.gitignore b/.gitignore index a4f7c60..8f187f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -bin node_modules public resources diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d918e7..084c3b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,35 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v0.3.5](https://github.com/h-enk/doks/compare/v0.3.4...v0.3.5) + +- feat: add versioning setup [`#478`](https://github.com/h-enk/doks/pull/478) +- feat: adjust latex svg image to dark theme [`#460`](https://github.com/h-enk/doks/pull/460) +- fix: edit-page multi-language support [`#459`](https://github.com/h-enk/doks/pull/459) +- feat: add docsRepoBranch config [`#458`](https://github.com/h-enk/doks/pull/458) +- feat: image max width [`#457`](https://github.com/h-enk/doks/pull/457) +- fix: docs url [`#456`](https://github.com/h-enk/doks/pull/456) +- chore(deps-dev): bump @babel/cli from 7.15.4 to 7.15.7 [`#463`](https://github.com/h-enk/doks/pull/463) +- feat: add multilingual support [`#454`](https://github.com/h-enk/doks/pull/454) +- deps: bump versions to latest [`94bacd3`](https://github.com/h-enk/doks/commit/94bacd3492e7b4d1e46aef13f86e5924ac645f4e) +- deps: bump @babel/cli from 7.15.4 to 7.15.7 [`130a13b`](https://github.com/h-enk/doks/commit/130a13bd9d3891d995e7373cc9a64fa527b4ce26) +- deps: bump versions to latest [`2503f5a`](https://github.com/h-enk/doks/commit/2503f5adf6d2650b82928a8770c2a1ccdc368a0c) + +#### [v0.3.4](https://github.com/h-enk/doks/compare/v0.3.3...v0.3.4) + +> 7 September 2021 + +- chore: update edit page default branch from master to main [`#426`](https://github.com/h-enk/doks/pull/426) +- Update index.js [`#417`](https://github.com/h-enk/doks/pull/417) +- Make id unique collapsible sidebar [`#378`](https://github.com/h-enk/doks/pull/378) +- deps: bump versions to latest [`8a98716`](https://github.com/h-enk/doks/commit/8a9871654e03b79082cfd9ebdf49a0a8ce7e21eb) +- deps: bump version to latest [`23d9dd7`](https://github.com/h-enk/doks/commit/23d9dd75c381b0440f4db717d63bea61baa0c584) +- deps: bump versions to latest [`700e566`](https://github.com/h-enk/doks/commit/700e56611d3a83f33e786f51a191728db7267248) + #### [v0.3.3](https://github.com/h-enk/doks/compare/v0.3.2...v0.3.3) +> 5 July 2021 + - Add Mermaid support [`#369`](https://github.com/h-enk/doks/pull/369) - Fix lint tests on Linux. [`#373`](https://github.com/h-enk/doks/pull/373) - feat: add mermaid [`f1fa5c5`](https://github.com/h-enk/doks/commit/f1fa5c5936558ff0b62d8a150bf303629bf50840) diff --git a/README.md b/README.md index 6cf137d..a703451 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@
- Doks is a Hugo theme helping you build modern documentation websites that are secure, fast, and SEO-ready — by default. + Doks is a Hugo theme for building secure, fast, and SEO-ready documentation websites, which you can easily update and customize.
@@ -23,6 +23,9 @@
+
+
+
@@ -39,7 +42,7 @@
## Why Doks?
-Nine reasons why you should use Doks:
+Nine main reasons why you should use Doks:
1. __Security aware__. Get A+ scores on [Mozilla Observatory](https://observatory.mozilla.org/analyze/doks.netlify.app) out of the box. Easily change the default Security Headers to suit your needs.
@@ -59,6 +62,14 @@ Nine reasons why you should use Doks:
9. __Dark mode__. Switch to a low-light UI with the click of a button. Change colors with variables to match your branding.
+### Other features
+
+- __Multilingual and i18n__ support
+- __Versioning__ documentation support
+- __KaTeX__ math typesetting
+- __Mermaid__ diagrams and visualization
+- __highlight.js__ syntax highlighting
+
## Requirements
Doks uses npm to centralize dependency management, making it [easy to update](https://getdoks.org/docs/help/how-to-update/) resources, build tooling, plugins, and build scripts:
@@ -117,3 +128,15 @@ Doks comes with [commands](https://getdoks.org/docs/prologue/commands/) for comm
- [Netlify Community](https://community.netlify.com/)
- [Hugo Forums](https://discourse.gohugo.io/)
- [Doks Discussions](https://github.com/h-enk/doks/discussions)
+
+## Sponsors
+
+Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
+
+[![OC sponsor 0](https://opencollective.com/doks/sponsor/0/avatar.svg)](https://opencollective.com/doks/sponsor/0/website)
+
+## Backers
+
+Support this project by becoming a backer. Your avatar will show up here.
+
+[![Backers](https://opencollective.com/doks/backers.svg)](https://opencollective.com/doks)
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 0000000..4ad3369
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,7 @@
+# Reporting Security Issues
+
+The Doks team and community take security issues in Doks seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
+
+To report a security issue, email [security@getdoks.org](mailto:security@getdoks.org) and include the word "SECURITY" in the subject line.
+
+We'll endeavor to respond quickly, and will keep you updated throughout the process.
diff --git a/assets/js/alert.js b/assets/js/alert.js
new file mode 100644
index 0000000..0fb2864
--- /dev/null
+++ b/assets/js/alert.js
@@ -0,0 +1,17 @@
+var announcement = document.getElementById('announcement');
+
+if (announcement !== null) {
+
+ if (localStorage.getItem('announcement') === null ) {
+
+ announcement.classList.remove('d-none');
+
+ }
+
+ announcement.addEventListener('closed.bs.alert', () => {
+
+ localStorage.setItem('announcement', 'closed');
+
+ });
+
+}
diff --git a/assets/js/darkmode-init.js b/assets/js/darkmode-init.js
new file mode 100644
index 0000000..0f3508d
--- /dev/null
+++ b/assets/js/darkmode-init.js
@@ -0,0 +1,21 @@
+const globalDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
+const localMode = localStorage.getItem('theme');
+
+if (globalDark && (localMode === null)) {
+
+ localStorage.setItem('theme', 'dark');
+ document.documentElement.setAttribute('data-dark-mode', '');
+
+}
+
+if (globalDark && (localMode === 'dark')) {
+
+ document.documentElement.setAttribute('data-dark-mode', '');
+
+}
+
+if (localMode === 'dark') {
+
+ document.documentElement.setAttribute('data-dark-mode', '');
+
+}
diff --git a/assets/js/darkmode.js b/assets/js/darkmode.js
index 4d8bcce..e81db47 100644
--- a/assets/js/darkmode.js
+++ b/assets/js/darkmode.js
@@ -1,12 +1,38 @@
-document.getElementById('mode').addEventListener('click', () => {
+const mode = document.getElementById('mode');
- document.body.classList.toggle('dark');
- localStorage.setItem('theme', document.body.classList.contains('dark') ? 'dark' : 'light');
+if (mode !== null) {
-});
+ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
-if (localStorage.getItem('theme') === 'dark') {
+ if (event.matches) {
- document.body.classList.add('dark');
+ localStorage.setItem('theme', 'dark');
+ document.documentElement.setAttribute('data-dark-mode', '');
+
+ } else {
+
+ localStorage.setItem('theme', 'light');
+ document.documentElement.removeAttribute('data-dark-mode');
+
+ }
+
+ })
+
+ mode.addEventListener('click', () => {
+
+ document.documentElement.toggleAttribute('data-dark-mode');
+ localStorage.setItem('theme', document.documentElement.hasAttribute('data-dark-mode') ? 'dark' : 'light');
+
+ });
+
+ if (localStorage.getItem('theme') === 'dark') {
+
+ document.documentElement.setAttribute('data-dark-mode', '');
+
+ } else {
+
+ document.documentElement.removeAttribute('data-dark-mode');
+
+ }
}
diff --git a/assets/js/index.js b/assets/js/index.js
index 0df2fd2..c10a58b 100644
--- a/assets/js/index.js
+++ b/assets/js/index.js
@@ -1,20 +1,19 @@
var suggestions = document.getElementById('suggestions');
-var userinput = document.getElementById('userinput');
+var search = document.getElementById('search');
-document.addEventListener('keydown', inputFocus);
+if (search !== null) {
+ document.addEventListener('keydown', inputFocus);
+}
function inputFocus(e) {
-
- if (e.keyCode === 191 ) {
+ if (e.ctrlKey && e.key === '/' ) {
e.preventDefault();
- userinput.focus();
+ search.focus();
}
-
- if (e.keyCode === 27 ) {
- userinput.blur();
+ if (e.key === 'Escape' ) {
+ search.blur();
suggestions.classList.add('d-none');
}
-
}
document.addEventListener('click', function(event) {
@@ -40,14 +39,16 @@ function suggestionFocus(e){
const focusable= [...focusableSuggestions];
const index = focusable.indexOf(document.activeElement);
+ const keyDefault = suggestions.classList.contains('d-none');
+
let nextIndex = 0;
- if (e.keyCode === 38) {
+ if ((e.keyCode === 38) && (!keyDefault)) {
e.preventDefault();
nextIndex= index > 0 ? index-1 : 0;
focusableSuggestions[nextIndex].focus();
}
- else if (e.keyCode === 40) {
+ else if ((e.keyCode === 40) && (!keyDefault)) {
e.preventDefault();
nextIndex= index+1 < focusable.length ? index+1 : index;
focusableSuggestions[nextIndex].focus();
@@ -55,7 +56,6 @@ function suggestionFocus(e){
}
-
/*
Source:
- https://github.com/nextapps-de/flexsearch#index-documents-field-search
@@ -102,7 +102,7 @@ Source:
{{ range $index, $element := $list -}}
{
id: {{ $index }},
- href: "{{ .Permalink }}",
+ href: "{{ .RelPermalink }}",
title: {{ .Title | jsonify }},
description: {{ .Params.description | jsonify }},
content: {{ .Content | jsonify }}
@@ -113,43 +113,40 @@ Source:
{{ end -}}
;
- userinput.addEventListener('input', show_results, true);
+ search.addEventListener('input', show_results, true);
suggestions.addEventListener('click', accept_suggestion, true);
function show_results(){
+ const maxResult = 5;
var value = this.value;
- var results = index.search(value, { limit: 5, index: ["content"], enrich: true });
- var entry, childs = suggestions.childNodes;
- var i = 0, len = results.length;
+ var results = index.search(value, {limit: maxResult, enrich: true});
suggestions.classList.remove('d-none');
+ suggestions.innerHTML = "";
- results.forEach(function(results) {
-
- entry = document.createElement('div');
-
- entry.innerHTML = '';
-
- a = entry.querySelector('a'),
- t = entry.querySelector('span:first-child'),
- d = entry.querySelector('span:nth-child(2)');
-
- // console.log(results);
-
- a.href = results.result[i].doc.href;
- t.textContent = results.result[i].doc.title;
- d.textContent = results.result[i].doc.description;
-
- suggestions.appendChild(entry);
-
+ //flatSearch now returns results for each index field. create a single list
+ const flatResults = {}; //keyed by href to dedupe results
+ results.forEach(result=>{
+ result.result.forEach(r=>{
+ flatResults[r.doc.href] = r.doc;
+ });
});
- while(childs.length > len){
+ //construct a list of suggestions list
+ for(const href in flatResults) {
+ const doc = flatResults[href];
- suggestions.removeChild(childs[i])
+ const entry = document.createElement('div');
+ entry.innerHTML = '';
+
+ entry.querySelector('a').href = href;
+ entry.querySelector('span:first-child').textContent = doc.title;
+ entry.querySelector('span:nth-child(2)').textContent = doc.description;
+
+ suggestions.appendChild(entry);
+ if(suggestions.childElementCount == maxResult) break;
}
-
}
function accept_suggestion(){
diff --git a/assets/scss/common/_dark.scss b/assets/scss/common/_dark.scss
index 479dfc1..81f30c0 100644
--- a/assets/scss/common/_dark.scss
+++ b/assets/scss/common/_dark.scss
@@ -4,7 +4,11 @@
$body-bg-dark: $gray-900;
$body-overlay-dark: darken($body-bg-dark, 2.5%);
+
+/*
$border-dark: darken($body-bg-dark, 2.5%);
+*/
+$border-dark: $gray-800;
$body-color-dark: $gray-300;
$dots-dark: darken($body-color-dark, 50%);
@@ -18,118 +22,165 @@ $navbar-dark-active-color: $link-color-dark;
/** Theme styles */
-body.dark {
+[data-dark-mode] body {
background: $body-bg-dark;
color: $body-color-dark;
}
-body.dark a {
+[data-dark-mode] body a {
color: $link-color-dark;
}
-body.dark a.text-body {
+[data-dark-mode] body a.text-body {
color: $body-color-dark !important;
}
-body.dark .btn-primary {
+[data-dark-mode] body .btn-primary {
@include button-variant($button-color-dark, $button-color-dark);
color: $body-bg-dark !important;
}
-body.dark .btn-outline-primary {
+[data-dark-mode] body .btn-outline-primary {
@include button-outline-variant($button-color-dark, $button-color-dark);
color: $link-color-dark;
}
-body.dark .btn-outline-primary:hover {
+[data-dark-mode] body .btn-outline-primary:hover {
color: $body-bg-dark;
}
-body.dark .navbar {
- background: $body-bg-dark;
- opacity: 0.975;
+[data-dark-mode] body .btn-doks-light {
+ color: $navbar-dark-color;
+}
+
+[data-dark-mode] body .show > .btn-doks-light,
+[data-dark-mode] body .btn-doks-light:hover,
+[data-dark-mode] body .btn-doks-light:active {
+ color: $link-color-dark;
+}
+
+[data-dark-mode] body .btn-menu svg {
+ color: $body-color-dark;
+}
+
+[data-dark-mode] body .doks-sidebar-toggle {
+ color: $navbar-dark-color;
+}
+
+[data-dark-mode] body .btn-menu:hover,
+[data-dark-mode] body .btn-doks-light:hover,
+[data-dark-mode] body .doks-sidebar-toggle:hover {
+ background: $body-overlay-dark;
+}
+
+/*
+[data-dark-mode] body .dropdown-menu {
+ @extend .dropdown-menu-dark;
+}
+*/
+
+[data-dark-mode] body .navbar,
+[data-dark-mode] body .doks-subnavbar {
+ background-color: rgba(33, 37, 41, 0.95);
border-bottom: 1px solid $border-dark;
}
-body.dark.home .navbar {
+[data-dark-mode] body.home .navbar {
border-bottom: 0;
}
-body.dark .navbar-light .navbar-brand {
+[data-dark-mode] body .offcanvas-header {
+ border-bottom: 1px solid $gray-800;
+}
+
+[data-dark-mode] body .offcanvas .nav-link {
+ color: $body-color-dark;
+}
+
+[data-dark-mode] body .offcanvas .nav-link:hover,
+[data-dark-mode] body .offcanvas .nav-link:focus {
+ color: $link-color-dark;
+}
+
+[data-dark-mode] body .offcanvas .nav-link.active {
+ color: $link-color-dark;
+}
+
+[data-dark-mode] body .navbar-light .navbar-brand {
color: $navbar-dark-color !important;
}
-body.dark .navbar-light .navbar-nav .nav-link {
+[data-dark-mode] body .navbar-light .navbar-nav .nav-link {
color: $navbar-dark-color;
}
-body.dark .navbar-light .navbar-nav .nav-link:hover,
-body.dark .navbar-light .navbar-nav .nav-link:focus {
+[data-dark-mode] body .navbar-light .navbar-nav .nav-link:hover,
+[data-dark-mode] body .navbar-light .navbar-nav .nav-link:focus {
color: $navbar-dark-hover-color;
}
-body.dark .navbar-light .navbar-nav .nav-link.disabled {
+[data-dark-mode] body .navbar-light .navbar-nav .nav-link.disabled {
color: $navbar-dark-disabled-color;
}
-body.dark .navbar-light .navbar-nav .show > .nav-link,
-body.dark .navbar-light .navbar-nav .active > .nav-link,
-body.dark .navbar-light .navbar-nav .nav-link.show,
-body.dark .navbar-light .navbar-nav .nav-link.active {
+[data-dark-mode] body .navbar-light .navbar-nav .show > .nav-link,
+[data-dark-mode] body .navbar-light .navbar-nav .active > .nav-link,
+[data-dark-mode] body .navbar-light .navbar-nav .nav-link.show,
+[data-dark-mode] body .navbar-light .navbar-nav .nav-link.active {
color: $navbar-dark-active-color;
}
-body.dark .navbar-light .navbar-text {
+[data-dark-mode] body .navbar-light .navbar-text {
color: $navbar-dark-color;
}
-body.dark .alert-primary a {
+[data-dark-mode] body .alert-primary a {
color: $body-bg-dark;
}
-body.dark .alert-warning {
+[data-dark-mode] body .alert-warning {
background: $body-overlay-dark;
color: $body-color-dark;
}
-body.dark .page-links a {
+[data-dark-mode] body .page-links a {
color: $body-color-dark;
}
-body.dark .btn-toggle-nav a {
+[data-dark-mode] body .btn-toggle-nav a {
color: $body-color-dark;
}
-body.dark .showcase-meta a {
+[data-dark-mode] body .showcase-meta a {
color: $body-color-dark;
}
-body.dark .showcase-meta a:hover,
-body.dark .showcase-meta a:focus {
+[data-dark-mode] body .showcase-meta a:hover,
+[data-dark-mode] body .showcase-meta a:focus {
color: $link-color-dark;
}
-body.dark .docs-link:hover,
-body.dark .docs-link.active,
-body.dark .page-links a:hover {
+[data-dark-mode] body .docs-link:hover,
+[data-dark-mode] body .docs-link.active,
+[data-dark-mode] body .page-links a:hover {
text-decoration: none;
color: $link-color-dark;
}
-body.dark .btn-toggle {
+[data-dark-mode] body .btn-toggle {
color: $body-color-dark;
background-color: transparent;
border: 0;
}
-body.dark .btn-toggle:hover,
-body.dark .btn-toggle:focus {
+[data-dark-mode] body .btn-toggle:hover,
+[data-dark-mode] body .btn-toggle:focus {
color: $body-color-dark;
}
-body.dark .btn-toggle::before {
+[data-dark-mode] body .btn-toggle::before {
width: 1.25em;
line-height: 0;
content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%28222, 226, 230, 0.75%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e");
@@ -138,59 +189,65 @@ body.dark .btn-toggle::before {
margin-bottom: 0.125rem;
}
-body.dark .btn-toggle[aria-expanded="true"] {
+[data-dark-mode] body .btn-toggle[aria-expanded="true"] {
color: $body-color-dark;
}
-body.dark .btn-toggle[aria-expanded="true"]::before {
+[data-dark-mode] body .btn-toggle[aria-expanded="true"]::before {
transform: rotate(90deg);
}
-body.dark .btn-toggle-nav a:hover,
-body.dark .btn-toggle-nav a:focus {
+[data-dark-mode] body .btn-toggle-nav a:hover,
+[data-dark-mode] body .btn-toggle-nav a:focus {
color: $link-color-dark;
}
-body.dark .btn-toggle-nav a.active {
+[data-dark-mode] body .btn-toggle-nav a.active {
color: $link-color-dark;
}
-body.dark .navbar-light .navbar-text a {
+[data-dark-mode] body .navbar-light .navbar-text a {
color: $navbar-dark-active-color;
}
-body.dark .docs-links h3.sidebar-link a,
-body.dark .page-links h3.sidebar-link a {
+[data-dark-mode] body .docs-links h3.sidebar-link a,
+[data-dark-mode] body .page-links h3.sidebar-link a {
color: $body-color-dark;
}
-body.dark .navbar-light .navbar-text a:hover,
-body.dark .navbar-light .navbar-text a:focus {
+[data-dark-mode] body .navbar-light .navbar-text a:hover,
+[data-dark-mode] body .navbar-light .navbar-text a:focus {
color: $navbar-dark-active-color;
}
-body.dark .navbar .btn-link {
+[data-dark-mode] body .navbar .btn-link {
color: $navbar-dark-color;
}
-body.dark .content .btn-link {
+[data-dark-mode] body .content .btn-link {
color: $link-color-dark;
}
-body.dark .content .btn-link:hover {
+[data-dark-mode] body .content .btn-link:hover {
color: $link-color-dark;
}
-body.dark .navbar .btn-link:hover {
+[data-dark-mode] body .content img[src^="https://latex.codecogs.com/svg.latex"] {
+ filter: invert(1);
+}
+
+[data-dark-mode] body .navbar .btn-link:hover {
color: $navbar-dark-hover-color;
}
-body.dark .navbar .btn-link:active {
+[data-dark-mode] body .navbar .btn-link:active {
color: $navbar-dark-active-color;
}
-body.dark .form-control.is-search {
+[data-dark-mode] body .form-control.is-search {
background: $body-overlay-dark;
+ border: 1px solid transparent;
+ color: $gray-300;
/*
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-search'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
@@ -200,180 +257,269 @@ body.dark .form-control.is-search {
*/
}
-body.dark .navbar-form::after {
+[data-dark-mode] body .form-control.is-search:focus {
+ border: 1px solid $link-color-dark;
+}
+
+[data-dark-mode] body .doks-search::after {
+ color: $gray-300;
+ border: 1px solid $gray-700;
+}
+
+[data-dark-mode] body .text-dark {
+ color: $body-color-dark !important;
+}
+
+/*
+[data-dark-mode] body .navbar-form::after {
color: $gray-600;
border: 1px solid $gray-800;
}
+*/
-body.dark .form-control {
- color: $gray-500;
+[data-dark-mode] body .form-control {
+ color: $gray-300;
}
-body.dark .form-control:focus {
- box-shadow: 0 0 0 0.2rem $focus-color-dark;
+[data-dark-mode] body .form-control::placeholder {
+ color: $gray-400;
+ opacity: 1;
}
-body.dark .border-top {
+[data-dark-mode] body .border-top {
border-top: 1px solid $border-dark !important;
}
@include media-breakpoint-up(lg) {
- body.dark .docs-sidebar {
+ [data-dark-mode] body .docs-sidebar {
order: 0;
border-right: 1px solid $border-dark;
}
}
-body.dark .docs-navigation {
+[data-dark-mode] body .docs-navigation {
border-top: 1px solid $border-dark;
}
-body.dark pre code::-webkit-scrollbar-thumb {
+[data-dark-mode] body pre code::-webkit-scrollbar-thumb {
background: $gray-400;
}
-body.dark pre code:hover {
- scrollbar-width: thin;
- scrollbar-color: $border-dark transparent;
-}
-
-body.dark pre code::-webkit-scrollbar-thumb:hover {
- background: $gray-500;
-}
-
-body.dark code:not(.hljs):not(.language-mermaid) {
+[data-dark-mode] body code:not(.hljs) {
background: $body-overlay-dark;
color: $body-color-dark;
}
-body.dark .mermaid,
-body.dark pre code.language-mermaid {
- background: $white;
+[data-dark-mode] body pre code:hover {
+ scrollbar-width: thin;
+ scrollbar-color: $border-dark transparent;
}
-body.dark blockquote {
+[data-dark-mode] body pre code::-webkit-scrollbar-thumb:hover {
+ background: $gray-500;
+}
+
+[data-dark-mode] body blockquote {
border-left: 3px solid $border-dark;
}
-body.dark .footer {
+[data-dark-mode] body .footer {
border-top: 1px solid $border-dark;
}
-body.dark .docs-links,
-body.dark .docs-toc {
+[data-dark-mode] body .docs-links,
+[data-dark-mode] body .docs-toc {
scrollbar-width: thin;
scrollbar-color: $body-bg-dark $body-bg-dark;
}
-body.dark .docs-links::-webkit-scrollbar,
-body.dark .docs-toc::-webkit-scrollbar {
+[data-dark-mode] body .docs-links::-webkit-scrollbar,
+[data-dark-mode] body .docs-toc::-webkit-scrollbar {
width: 5px;
}
-body.dark .docs-links::-webkit-scrollbar-track,
-body.dark .docs-toc::-webkit-scrollbar-track {
+[data-dark-mode] body .docs-links::-webkit-scrollbar-track,
+[data-dark-mode] body .docs-toc::-webkit-scrollbar-track {
background: $body-bg-dark;
}
-body.dark .docs-links::-webkit-scrollbar-thumb,
-body.dark .docs-toc::-webkit-scrollbar-thumb {
+[data-dark-mode] body .docs-links::-webkit-scrollbar-thumb,
+[data-dark-mode] body .docs-toc::-webkit-scrollbar-thumb {
background: $body-bg-dark;
}
-body.dark .docs-links:hover,
-body.dark .docs-toc:hover {
+[data-dark-mode] body .docs-links:hover,
+[data-dark-mode] body .docs-toc:hover {
scrollbar-width: thin;
scrollbar-color: $border-dark $body-bg-dark;
}
-body.dark .docs-links:hover::-webkit-scrollbar-thumb,
-body.dark .docs-toc:hover::-webkit-scrollbar-thumb {
+[data-dark-mode] body .docs-links:hover::-webkit-scrollbar-thumb,
+[data-dark-mode] body .docs-toc:hover::-webkit-scrollbar-thumb {
background: $border-dark;
}
-body.dark .docs-links::-webkit-scrollbar-thumb:hover,
-body.dark .docs-toc::-webkit-scrollbar-thumb:hover {
+[data-dark-mode] body .docs-links::-webkit-scrollbar-thumb:hover,
+[data-dark-mode] body .docs-toc::-webkit-scrollbar-thumb:hover {
background: $border-dark;
}
-body.dark .docs-links h3:not(:first-child) {
+[data-dark-mode] body .docs-links h3:not(:first-child) {
border-top: 1px solid $border-dark;
}
-body.dark a.docs-link {
+[data-dark-mode] body a.docs-link {
color: $body-color-dark;
}
-body.dark .page-links li:not(:first-child) {
+[data-dark-mode] body .page-links li:not(:first-child) {
border-top: 1px dashed $border-dark;
}
-body.dark .card {
+[data-dark-mode] body .card {
background: $body-bg-dark;
border: 1px solid $border-dark;
}
-body.dark .card.bg-light {
+[data-dark-mode] body .card.bg-light {
background: $body-overlay-dark !important;
}
-body.dark .navbar .menu-icon .navicon {
+[data-dark-mode] body .navbar .menu-icon .navicon {
background: $navbar-dark-color;
}
-body.dark .navbar .menu-icon .navicon::before,
-body.dark .navbar .menu-icon .navicon::after {
+[data-dark-mode] body .navbar .menu-icon .navicon::before,
+[data-dark-mode] body .navbar .menu-icon .navicon::after {
background: $navbar-dark-color;
}
-body.dark .logo-light {
+[data-dark-mode] body .logo-light {
display: none !important;
}
-body.dark .logo-dark {
+[data-dark-mode] body .logo-dark {
display: inline-block !important;
}
-body.dark .bg-light {
+[data-dark-mode] body .bg-light {
background: darken($body-bg-dark, 1.5%) !important;
}
-body.dark .bg-dots {
+[data-dark-mode] body .bg-dots {
background-image: radial-gradient($dots-dark 15%, transparent 15%);
}
-body.dark .text-muted {
+[data-dark-mode] body .text-muted {
color: darken($body-color-dark, 7.5%) !important;
}
-body.dark .alert-primary {
+[data-dark-mode] body .alert-primary {
background: $link-color-dark;
color: $body-bg-dark;
}
-body.dark .figure-caption {
+[data-dark-mode] body .figure-caption {
color: $body-color-dark;
}
-body.dark table {
+[data-dark-mode] body table {
@extend .table-dark;
}
-body.dark .copy-status::after {
+[data-dark-mode] body .copy-status::after {
content: "Copy";
display: block;
color: $body-color-dark;
}
-body.dark .copy-status:hover::after {
+[data-dark-mode] body .copy-status:hover::after {
content: "Copy";
display: block;
color: $link-color-dark;
}
-body.dark .copy-status:focus::after,
-body.dark .copy-status:active::after {
+[data-dark-mode] body .copy-status:focus::after,
+[data-dark-mode] body .copy-status:active::after {
content: "Copied";
display: block;
color: $link-color-dark;
}
+
+/*
+[data-dark-mode] body .dropdown-toggle:focus,
+[data-dark-mode] body .doks-sidebar-toggle:focus {
+ box-shadow: 0 0 0 0.2rem $focus-color-dark;
+}
+*/
+
+[data-dark-mode] body .offcanvas {
+ background-color: $body-bg-dark;
+}
+
+[data-dark-mode] body .btn-close {
+ background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNkZWUyZTYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLXgiPjxsaW5lIHgxPSIxOCIgeTE9IjYiIHgyPSI2IiB5Mj0iMTgiPjwvbGluZT48bGluZSB4MT0iNiIgeTE9IjYiIHgyPSIxOCIgeTI9IjE4Ij48L2xpbmU+PC9zdmc+");
+ background-size: 1.5rem;
+}
+
+@include media-breakpoint-up(md) {
+ [data-dark-mode] body .alert-dismissible .btn-close {
+ background-size: 1.25rem;
+ }
+}
+
+/*
+[data-dark-mode] body .btn-close:focus {
+ box-shadow: 0 0 0 0.2rem $focus-color-dark;
+}
+*/
+
+[data-dark-mode] .dropdown-item {
+ color: $body-bg-dark;
+}
+
+[data-dark-mode] body hr.text-black-50 {
+ color: $gray-600 !important;
+}
+
+[data-dark-mode] body .email-form .form-control {
+ background: $body-overlay-dark;
+ border: 1px solid transparent;
+}
+
+[data-dark-mode] body .email-form .form-control:focus {
+ border: 1px solid $link-color-dark;
+}
+
+[data-dark-mode] .page-link {
+ color: $link-color-dark;
+ background-color: transparent;
+ border: $pagination-border-width solid $border-dark;
+
+ &:hover {
+ color: $body-bg-dark;
+ background-color: $body-color-dark;
+ border-color: $body-color-dark;
+ }
+
+ &:focus {
+ color: $body-bg-dark;
+ background-color: $body-color-dark;
+ }
+}
+
+[data-dark-mode] .page-item {
+ &.active .page-link {
+ color: $body-bg-dark;
+
+ @include gradient-bg($link-color-dark);
+
+ border-color: $link-color-dark;
+ }
+
+ &.disabled .page-link {
+ color: $pagination-disabled-color;
+ background-color: $body-overlay-dark;
+ border-color: $border-dark;
+ }
+}
diff --git a/assets/scss/common/_global.scss b/assets/scss/common/_global.scss
index ad45503..7e6c572 100644
--- a/assets/scss/common/_global.scss
+++ b/assets/scss/common/_global.scss
@@ -9,6 +9,10 @@
padding-bottom: 3rem;
}
+.content img {
+ max-width: 100%;
+}
+
h1,
h2,
h3,
@@ -24,10 +28,27 @@ h6,
margin: 2rem 0 1rem;
}
+.offcanvas-header {
+ border-bottom: 1px solid $gray-300;
+ padding-top: 1.0625rem;
+ padding-bottom: 0.8125rem;
+}
+
+h5.offcanvas-title {
+ margin: 0;
+}
+
+body.docs {
+ padding-top: 0 !important;
+}
+
@include media-breakpoint-up(md) {
body {
font-size: $font-size-md;
+
+ /*
padding-top: 4rem !important;
+ */
}
h1,
@@ -85,9 +106,11 @@ a.btn:focus {
}
*/
+/*
body {
padding-top: 3.5625rem;
}
+*/
.docs-sidebar {
order: 2;
@@ -227,3 +250,23 @@ body {
.katex {
font-size: $font-size-md;
}
+
+.card-bar {
+ border-top: 4px solid;
+ border-image-source: linear-gradient(90deg, $primary, #8ed6fb 50%, #d32e9d);
+ border-image-slice: 1;
+}
+
+.modal-backdrop {
+ background-color: #fff;
+}
+
+.modal-backdrop.show {
+ opacity: 0.7;
+}
+
+@include media-breakpoint-up(md) {
+ .modal-backdrop.show {
+ opacity: 0;
+ }
+}
diff --git a/assets/scss/common/_variables.scss b/assets/scss/common/_variables.scss
index eab8191..0baa1ec 100644
--- a/assets/scss/common/_variables.scss
+++ b/assets/scss/common/_variables.scss
@@ -20,6 +20,7 @@ $purple: #5d2f86;
$brown: #aa9c84;
$blue-300: #8ed6fb;
+$pink-100: #fcfaff;
$pink-500: #d32e9d;
$primary: $purple;
@@ -115,7 +116,7 @@ $font-size-lg: $font-size-base * 1.25;
$font-size-md: $font-size-base * 1.125;
$font-size-sm: $font-size-base * 0.875;
-$line-height-base: 1.5;
+// $line-height-base: 1.5;
$headings-font-family: null;
$headings-font-weight: 700;
@@ -159,3 +160,30 @@ $alert-border-width: 0;
$alert-bg-scale: 0;
$alert-border-scale: 0;
$alert-color-scale: 0;
+
+// docsearch
+$dropdown-config: (
+ main-color: $purple,
+ layout-type: normal,
+ layout-width: normal,
+ layout-alignment: align,
+ background-color: $white,
+ border-radius: 4,
+ border-width: 1,
+ border-color: $gray-200,
+ box-shadow: none,
+ branding-position: bottom,
+ spacing: normal,
+ include-desc: yes,
+ background-category-header: $white,
+ font-size: normal,
+ header-color: $black,
+ title-color: $black,
+ subtitle-color: $black,
+ text-color: $black,
+ highlight-color: $purple,
+ highlight-opacity: 0.1,
+ highlight-type: underline
+);
+
+$input-btn-focus-width: 0;
diff --git a/assets/scss/components/_alerts.scss b/assets/scss/components/_alerts.scss
index ae6fbf7..bce819d 100644
--- a/assets/scss/components/_alerts.scss
+++ b/assets/scss/components/_alerts.scss
@@ -7,7 +7,7 @@
margin-right: 0.75rem;
}
-.docs .alert {
+.docs main .alert {
margin: 2rem -1.5rem;
}
@@ -62,6 +62,28 @@
text-decoration: none;
}
+.alert-dismissible .btn-close {
+ position: absolute;
+
+ /*
+ top: 50%;
+ transform: translateY(-50%);
+ */
+ top: 0.75rem;
+ right: 1rem;
+ z-index: 2;
+ padding: 0.625rem;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-x'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
+ background-size: 1.5rem;
+ filter: invert(1) grayscale(100%) brightness(200%);
+}
+
+@include media-breakpoint-up(md) {
+ .alert-dismissible .btn-close {
+ background-size: 1.25rem;
+ }
+}
+
.alert code {
background: darken($beige, 5%);
color: $black;
diff --git a/assets/scss/components/_buttons.scss b/assets/scss/components/_buttons.scss
index 713f819..5e8cb2f 100644
--- a/assets/scss/components/_buttons.scss
+++ b/assets/scss/components/_buttons.scss
@@ -4,7 +4,9 @@
}
#mode {
- margin-right: 1.25rem;
+ padding-right: 0.25rem;
+ padding-left: 0.25rem;
+ margin-right: -0.25rem;
}
.btn-link:focus {
@@ -18,7 +20,8 @@
@include media-breakpoint-up(md) {
#mode {
- margin-right: 0.5rem;
+ margin-left: 1.125rem;
+ margin-right: -0.375rem;
}
.navbar .btn-link {
@@ -42,11 +45,11 @@ body .toggle-light {
display: none;
}
-body.dark .toggle-light {
+[data-dark-mode] body .toggle-light {
display: block;
}
-body.dark .toggle-dark {
+[data-dark-mode] body .toggle-dark {
display: none;
}
@@ -183,3 +186,35 @@ pre {
.btn-toggle-nav a.active {
color: $link-color;
}
+
+.doks-navbar .dropdown-menu,
+.doks-subnavbar .dropdown-menu {
+ font-size: 0.875rem;
+}
+
+.doks-navbar .dropdown-item.current,
+.doks-subnavbar .dropdown-item.current {
+ font-weight: 600;
+ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23292b2c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
+ background-repeat: no-repeat;
+ background-position: right 1rem top 0.6rem;
+ background-size: 0.75rem 0.75rem;
+}
+
+.btn-close {
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-x'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
+ background-size: 1.5rem;
+}
+
+.offcanvas-header .btn-close {
+ margin-right: 0 !important;
+}
+
+.dropdown-toggle::after {
+ display: none;
+}
+
+.dropdown-caret {
+ margin-left: -0.1875rem;
+ margin-right: -0.3125rem;
+}
diff --git a/assets/scss/components/_code.scss b/assets/scss/components/_code.scss
index eb0c0a0..84ad2bc 100644
--- a/assets/scss/components/_code.scss
+++ b/assets/scss/components/_code.scss
@@ -28,7 +28,7 @@ pre code {
}
.hljs {
- padding: 1.25rem 1.5rem;
+ padding: 1.5rem !important;
}
@include media-breakpoint-down(sm) {
diff --git a/assets/scss/components/_search.scss b/assets/scss/components/_search.scss
index 3a70b2b..6beebf2 100644
--- a/assets/scss/components/_search.scss
+++ b/assets/scss/components/_search.scss
@@ -4,9 +4,10 @@
#suggestions {
position: absolute;
- right: 0;
+ left: 0;
margin-top: 0.5rem;
width: calc(100vw - 3rem);
+ z-index: $zindex-dropdown;
}
#suggestions a {
@@ -53,7 +54,7 @@
@include media-breakpoint-up(sm) {
#suggestions {
- width: 30rem;
+ width: 31.125rem;
}
#suggestions a {
diff --git a/assets/scss/components/_syntax.scss b/assets/scss/components/_syntax.scss
index a439178..2be315d 100644
--- a/assets/scss/components/_syntax.scss
+++ b/assets/scss/components/_syntax.scss
@@ -44,19 +44,19 @@ Based on Ascetic by (c) Ivan Sagalaev