Merge pull request #126 from dillonzq/feature/custom_toc_font_size
feat(toc): add custom TOC font size
This commit is contained in:
@@ -83,7 +83,6 @@
|
|||||||
display: block;
|
display: block;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
font-size: 1.2em;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
line-height: 2em;
|
line-height: 2em;
|
||||||
padding: 0 .625rem;
|
padding: 0 .625rem;
|
||||||
@@ -133,6 +132,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.toc {
|
.toc {
|
||||||
|
.toc-title {
|
||||||
|
font-size: $toc-title-font-size;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toc-content {
|
||||||
|
font-size: $toc-content-font-size;
|
||||||
|
}
|
||||||
|
|
||||||
ruby {
|
ruby {
|
||||||
background: $code-background-color;
|
background: $code-background-color;
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,10 @@ $header-hover-color-dark: #fff !default;
|
|||||||
// ========== Header ========== //
|
// ========== Header ========== //
|
||||||
|
|
||||||
// ========== Single Content ========== //
|
// ========== Single Content ========== //
|
||||||
|
// Font size of the TOC
|
||||||
|
$toc-title-font-size: 1.2rem !default;
|
||||||
|
$toc-content-font-size: 0.9rem !default;
|
||||||
|
|
||||||
// Color of the single link
|
// Color of the single link
|
||||||
$single-link-color: #2d96bd !default;
|
$single-link-color: #2d96bd !default;
|
||||||
$single-link-color-dark: #eee !default;
|
$single-link-color-dark: #eee !default;
|
||||||
|
|||||||
2
assets/js/theme.min.js
vendored
2
assets/js/theme.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -119,7 +119,7 @@
|
|||||||
}
|
}
|
||||||
const toc = document.getElementById('toc-auto');
|
const toc = document.getElementById('toc-auto');
|
||||||
const page = document.getElementsByClassName('page')[0];
|
const page = document.getElementsByClassName('page')[0];
|
||||||
toc.style.maxWidth = `${page.getBoundingClientRect().left - 40}px`;
|
toc.style.maxWidth = `${page.getBoundingClientRect().left - 20}px`;
|
||||||
this._tocLinks = this._tocLinks || tocCore.getElementsByTagName('a');
|
this._tocLinks = this._tocLinks || tocCore.getElementsByTagName('a');
|
||||||
this._tocLis = this._tocLis || tocCore.getElementsByTagName('li');
|
this._tocLis = this._tocLis || tocCore.getElementsByTagName('li');
|
||||||
this._headerLinks = this._headerLinks || document.getElementsByClassName('headerLink') || [];
|
this._headerLinks = this._headerLinks || document.getElementsByClassName('headerLink') || [];
|
||||||
|
|||||||
Reference in New Issue
Block a user