mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-30 07:32:39 +01:00
Made docs sidebar sticky, changed theme to default
- MDN theme appeared fairly bad for markdown use, and the geometric background was a bit much. Swapped out to default theme. - Rough-added stickiness to docs sidebar, will need more work once it starts to expand possible screen height.
This commit is contained in:
parent
5ce3b861a9
commit
dea8343bc8
@ -185,7 +185,7 @@ function getMode(suggestion, content) {
|
||||
* @returns {*|string}
|
||||
*/
|
||||
function getTheme() {
|
||||
return window.codeTheme || 'mdn-like';
|
||||
return window.codeTheme || 'default';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -258,4 +258,9 @@
|
||||
&[data-method="POST"] { background-color: #cf4d03 }
|
||||
&[data-method="PUT"] { background-color: #0288D1 }
|
||||
&[data-method="DELETE"] { background-color: #ab0f0e }
|
||||
}
|
||||
|
||||
.sticky-sidebar {
|
||||
position: sticky;
|
||||
top: $-m;
|
||||
}
|
@ -341,53 +341,55 @@ div.CodeMirror-dragcursors {
|
||||
/* Help users use markselection to safely style text background */
|
||||
span.CodeMirror-selectedtext { background: none; }
|
||||
|
||||
/**
|
||||
* Codemirror Default theme
|
||||
*/
|
||||
|
||||
/*
|
||||
MDN-LIKE Theme - Mozilla
|
||||
Ported to CodeMirror by Peter Kroon <plakroon@gmail.com>
|
||||
Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues
|
||||
GitHub: @peterkroon
|
||||
.cm-s-default .cm-header {color: blue;}
|
||||
.cm-s-default .cm-quote {color: #090;}
|
||||
.cm-negative {color: #d44;}
|
||||
.cm-positive {color: #292;}
|
||||
.cm-header, .cm-strong {font-weight: bold;}
|
||||
.cm-em {font-style: italic;}
|
||||
.cm-link {text-decoration: underline;}
|
||||
.cm-strikethrough {text-decoration: line-through;}
|
||||
|
||||
The mdn-like theme is inspired on the displayed code examples at: https://developer.mozilla.org/en-US/docs/Web/CSS/animation
|
||||
.cm-s-default .cm-keyword {color: #708;}
|
||||
.cm-s-default .cm-atom {color: #219;}
|
||||
.cm-s-default .cm-number {color: #164;}
|
||||
.cm-s-default .cm-def {color: #00f;}
|
||||
.cm-s-default .cm-variable,
|
||||
.cm-s-default .cm-punctuation,
|
||||
.cm-s-default .cm-property,
|
||||
.cm-s-default .cm-operator {}
|
||||
.cm-s-default .cm-variable-2 {color: #05a;}
|
||||
.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
|
||||
.cm-s-default .cm-comment {color: #a50;}
|
||||
.cm-s-default .cm-string {color: #a11;}
|
||||
.cm-s-default .cm-string-2 {color: #f50;}
|
||||
.cm-s-default .cm-meta {color: #555;}
|
||||
.cm-s-default .cm-qualifier {color: #555;}
|
||||
.cm-s-default .cm-builtin {color: #30a;}
|
||||
.cm-s-default .cm-bracket {color: #997;}
|
||||
.cm-s-default .cm-tag {color: #170;}
|
||||
.cm-s-default .cm-attribute {color: #00c;}
|
||||
.cm-s-default .cm-hr {color: #999;}
|
||||
.cm-s-default .cm-link {color: #00c;}
|
||||
|
||||
*/
|
||||
.cm-s-mdn-like.CodeMirror { color: #999; background-color: #fff; }
|
||||
.cm-s-mdn-like div.CodeMirror-selected { background: #cfc; }
|
||||
.cm-s-mdn-like .CodeMirror-line::selection, .cm-s-mdn-like .CodeMirror-line > span::selection, .cm-s-mdn-like .CodeMirror-line > span > span::selection { background: #cfc; }
|
||||
.cm-s-mdn-like .CodeMirror-line::-moz-selection, .cm-s-mdn-like .CodeMirror-line > span::-moz-selection, .cm-s-mdn-like .CodeMirror-line > span > span::-moz-selection { background: #cfc; }
|
||||
.cm-s-default .cm-error {color: #f00;}
|
||||
.cm-invalidchar {color: #f00;}
|
||||
|
||||
.cm-s-mdn-like .CodeMirror-gutters { background: #f8f8f8; border-left: 6px solid rgba(0,83,159,0.65); color: #333; }
|
||||
.cm-s-mdn-like .CodeMirror-linenumber { color: #aaa; padding-left: 8px; }
|
||||
.cm-s-mdn-like .CodeMirror-cursor { border-left: 2px solid #222; }
|
||||
.CodeMirror-composing { border-bottom: 2px solid; }
|
||||
|
||||
.cm-s-mdn-like .cm-keyword { color: #6262FF; }
|
||||
.cm-s-mdn-like .cm-atom { color: #F90; }
|
||||
.cm-s-mdn-like .cm-number { color: #ca7841; }
|
||||
.cm-s-mdn-like .cm-def { color: #8DA6CE; }
|
||||
.cm-s-mdn-like span.cm-variable-2, .cm-s-mdn-like span.cm-tag { color: #690; }
|
||||
.cm-s-mdn-like span.cm-variable-3, .cm-s-mdn-like span.cm-def, .cm-s-mdn-like span.cm-type { color: #07a; }
|
||||
/* Default styles for common addons */
|
||||
|
||||
.cm-s-mdn-like .cm-variable { color: #07a; }
|
||||
.cm-s-mdn-like .cm-property { color: #905; }
|
||||
.cm-s-mdn-like .cm-qualifier { color: #690; }
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
|
||||
.CodeMirror-activeline-background {background: #e8f2ff;}
|
||||
|
||||
.cm-s-mdn-like .cm-operator { color: #cda869; }
|
||||
.cm-s-mdn-like .cm-comment { color:#777; font-weight:normal; }
|
||||
.cm-s-mdn-like .cm-string { color:#07a; font-style:italic; }
|
||||
.cm-s-mdn-like .cm-string-2 { color:#bd6b18; } /*?*/
|
||||
.cm-s-mdn-like .cm-meta { color: #000; } /*?*/
|
||||
.cm-s-mdn-like .cm-builtin { color: #9B7536; } /*?*/
|
||||
.cm-s-mdn-like .cm-tag { color: #997643; }
|
||||
.cm-s-mdn-like .cm-attribute { color: #d6bb6d; } /*?*/
|
||||
.cm-s-mdn-like .cm-header { color: #FF6400; }
|
||||
.cm-s-mdn-like .cm-hr { color: #AEAEAE; }
|
||||
.cm-s-mdn-like .cm-link { color:#ad9361; font-style:italic; text-decoration:none; }
|
||||
.cm-s-mdn-like .cm-error { border-bottom: 1px solid red; }
|
||||
/* STOP */
|
||||
|
||||
div.cm-s-mdn-like .CodeMirror-activeline-background { background: #efefff; }
|
||||
div.cm-s-mdn-like span.CodeMirror-matchingbracket { outline:1px solid grey; color: inherit; }
|
||||
|
||||
.cm-s-mdn-like.CodeMirror { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAAAyCAYAAAAp8UeFAAAHvklEQVR42s2b63bcNgyEQZCSHCdt2vd/0tWF7I+Q6XgMXiTtuvU5Pl57ZQKkKHzEAOtF5KeIJBGJ8uvL599FRFREZhFx8DeXv8trn68RuGaC8TRfo3SNp9dlDDHedyLyTUTeRWStXKPZrjtpZxaRw5hPqozRs1N8/enzIiQRWcCgy4MUA0f+XWliDhyL8Lfyvx7ei/Ae3iQFHyw7U/59pQVIMEEPEz0G7XiwdRjzSfC3UTtz9vchIntxvry5iMgfIhJoEflOz2CQr3F5h/HfeFe+GTdLaKcu9L8LTeQb/R/7GgbsfKedyNdoHsN31uRPWrfZ5wsj/NzzRQHuToIdU3ahwnsKPxXCjJITuOsi7XLc7SG/v5GdALs7wf8JjTFiB5+QvTEfRyGOfX3Lrx8wxyQi3sNq46O7QahQiCsRFgqddjBouVEHOKDgXAQHD9gJCr5sMKkEdjwsarG/ww3BMHBU7OBjXnzdyY7SfCxf5/z6ATccrwlKuwC/jhznnPF4CgVzhhVf4xp2EixcBActO75iZ8/fM9zAs2OMzKdslgXWJ9XG8PQoOAMA5fGcsvORgv0doBXyHrCwfLJAOwo71QLNkb8n2Pl6EWiR7OCibtkPaz4Kc/0NNAze2gju3zOwekALDaCFPI5vjPFmgGY5AZqyGEvH1x7QfIb8YtxMnA/b+QQ0aQDAwc6JMFg8CbQZ4qoYEEHbRwNojuK3EHwd7VALSgq+MNDKzfT58T8qdpADrgW0GmgcAS1lhzztJmkAzcPNOQbsWEALBDSlMKUG0Eq4CLAQWvEVQ9WU57gZJwZtgPO3r9oBTQ9WO8TjqXINx8R0EYpiZEUWOF3FxkbJkgU9B2f41YBrIj5ZfsQa0M5kTgiAAqM3ShXLgu8XMqcrQBvJ0CL5pnTsfMB13oB8athpAq2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ZaX0NAEyMbYaAlyquFoLKK3SPby9CeVUPThrSJmkCAE0CrKUQadi4DrdSlWhmah0YL9z9vClH59YGbHx1J8VZTyAjQepJjmXwAKTDQI3omc3p1U4gDUf6RfcdYfrUp5ClAi2J3Ba6UOXGo+K+bQrjjssitG2SJzshaLwMtXgRagUNpYYoVkMSBLM+9GGiJZMvduG6DRZ4qc04DMPtQQxOjEtACmhO7K1AbNbQDEggZyJwscFpAGwENhoBeUwh3bWolhe8BTYVKxQEWrSUn/uhcM5KhvUu/+eQu0Lzhi+VrK0PrZZNDQKs9cpYUuFYgMVpD4/NxenJTiMCNqdUEUf1qZWjppLT5qSkkUZbCwkbZMSuVnu80hfSkzRbQeqCZSAh6huR4VtoM2gHAlLf72smuWgE+VV7XpE25Ab2WFDgyhnSuKbs4GuGzCjR+tIoUuMFg3kgcWKLTwRqanJQ2W00hAsenfaApRC42hbCvK1SlE0HtE9BGgneJO+ELamitD1YjjOYnNYVcraGhtKkW0EqVVeDx733I2NH581k1NNxNLG0i0IJ8/NjVaOZ0tYZ2Vtr0Xv7tPV3hkWp9EFkgS/J0vosngTaSoaG06WHi+xObQkaAdlbanP8B2+2l0f90LmUAAAAASUVORK5CYII=); }
|
||||
|
||||
/**
|
||||
* Custom BookStack overrides
|
||||
|
@ -116,7 +116,6 @@ body.flexbox {
|
||||
min-height: 0;
|
||||
max-width: 100%;
|
||||
position: relative;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.flex {
|
||||
|
@ -7,29 +7,31 @@
|
||||
<div class="grid right-focus reverse-collapse">
|
||||
<div>
|
||||
|
||||
<p class="text-uppercase text-muted mb-xm mt-l"><strong>Getting Started</strong></p>
|
||||
<div class="sticky-sidebar">
|
||||
<p class="text-uppercase text-muted mb-xm mt-l"><strong>Getting Started</strong></p>
|
||||
|
||||
<div class="text-mono">
|
||||
<div class="mb-xs"><a href="#authentication">Authentication</a></div>
|
||||
<div class="mb-xs"><a href="#request-format">Request Format</a></div>
|
||||
<div class="mb-xs"><a href="#listing-endpoints">Listing Endpoints</a></div>
|
||||
<div class="mb-xs"><a href="#error-handling">Error Handling</a></div>
|
||||
</div>
|
||||
<div class="text-mono">
|
||||
<div class="mb-xs"><a href="#authentication">Authentication</a></div>
|
||||
<div class="mb-xs"><a href="#request-format">Request Format</a></div>
|
||||
<div class="mb-xs"><a href="#listing-endpoints">Listing Endpoints</a></div>
|
||||
<div class="mb-xs"><a href="#error-handling">Error Handling</a></div>
|
||||
</div>
|
||||
|
||||
@foreach($docs as $model => $endpoints)
|
||||
<p class="text-uppercase text-muted mb-xm mt-l"><strong>{{ $model }}</strong></p>
|
||||
@foreach($docs as $model => $endpoints)
|
||||
<p class="text-uppercase text-muted mb-xm mt-l"><strong>{{ $model }}</strong></p>
|
||||
|
||||
@foreach($endpoints as $endpoint)
|
||||
<div class="mb-xs">
|
||||
<a href="#{{ $endpoint['name'] }}" class="text-mono inline block mr-s">
|
||||
<span class="api-method" data-method="{{ $endpoint['method'] }}">{{ $endpoint['method'] }}</span>
|
||||
</a>
|
||||
<a href="#{{ $endpoint['name'] }}" class="text-mono">
|
||||
{{ $endpoint['controller_method'] }}
|
||||
</a>
|
||||
</div>
|
||||
@foreach($endpoints as $endpoint)
|
||||
<div class="mb-xs">
|
||||
<a href="#{{ $endpoint['name'] }}" class="text-mono inline block mr-s">
|
||||
<span class="api-method" data-method="{{ $endpoint['method'] }}">{{ $endpoint['method'] }}</span>
|
||||
</a>
|
||||
<a href="#{{ $endpoint['name'] }}" class="text-mono">
|
||||
{{ $endpoint['controller_method'] }}
|
||||
</a>
|
||||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="overflow: auto;">
|
||||
|
Loading…
Reference in New Issue
Block a user