From 8da38da937554839340f20f2286e9210fd0f5cec Mon Sep 17 00:00:00 2001 From: danpros Date: Wed, 21 Feb 2024 18:52:21 +0700 Subject: [PATCH] Styling the TOC --- themes/blog/css/styles.css | 46 ++++++++++++++++++++++++++++++++ themes/clean/css/style.css | 50 +++++++++++++++++++++++++++++++++-- themes/clean/static.html.php | 1 + themes/doks/css/style.css | 46 ++++++++++++++++++++++++++++++++ themes/doks/js/toc.js | 7 ----- themes/logs/css/style.css | 46 ++++++++++++++++++++++++++++++++ themes/readable/css/style.css | 46 ++++++++++++++++++++++++++++++++ themes/twentyfifteen/css/style.css | 46 ++++++++++++++++++++++++++++++++ themes/twentyfifteen/css/style_v2.css | 46 ++++++++++++++++++++++++++++++++ themes/twentysixteen/css/style.css | 46 ++++++++++++++++++++++++++++++++ 10 files changed, 371 insertions(+), 9 deletions(-) diff --git a/themes/blog/css/styles.css b/themes/blog/css/styles.css index d0314e1..399f3c5 100644 --- a/themes/blog/css/styles.css +++ b/themes/blog/css/styles.css @@ -628,4 +628,50 @@ ul.month { display:inline; margin:0 0 0 10px; float:right; +} + +summary { + display: list-item; + cursor: pointer; +} + +.toc-wrapper { + background: #f9f9f9; + border: 1px solid #aaa; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); + box-shadow: 0 1px 1px rgba(0,0,0,.05); + margin-bottom: 1.5em; + padding: 10px; + position: relative; + width: auto; + font-size: 90%; +} + +.toc-wrapper .inner { + margin-top:5px; +} + +.toc-wrapper .inner a { + border: none; + box-shadow:none; +} + +.toc .h3-toc { + margin-left: .20in; +} +.toc .h4-toc { + margin-left: .35in; +} +.toc .h5-toc { + margin-left: .50in; +} +.toc .h6-toc { + margin-left: .65in; +} + +.toc-link a.anchor { + border:none; + margin-left: 5px; + box-shadow:none; } \ No newline at end of file diff --git a/themes/clean/css/style.css b/themes/clean/css/style.css index f4f2026..6d24a86 100644 --- a/themes/clean/css/style.css +++ b/themes/clean/css/style.css @@ -211,7 +211,7 @@ h6 { text-decoration: none; } -.in-front .post, .in-tag .post, .in-archive .post, .in-search .post, .in-profile .post { +.in-front .post, .in-tag .post, .in-archive .post, .in-search .post, .in-profile .post, .in-category .post, .in-blog .post, .in-type .post{ border-bottom: 1px solid #dfdfdf; padding: 30px 0 10px 0; } @@ -949,4 +949,50 @@ ul.archivegroup { .archivegroup li.expanded, .archivegroup li.collapsed, .archivegroup li.expanded li, .archivegroup li.collapsed li { list-style: none; background:none; -} \ No newline at end of file +} + +summary { + display: list-item; + cursor: pointer; +} + +.toc-wrapper { + background: #f9f9f9; + border: 1px solid #aaa; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); + box-shadow: 0 1px 1px rgba(0,0,0,.05); + margin-bottom: 1.5em; + padding: 10px; + position: relative; + width: auto; + font-size: 90%; +} + +.toc-wrapper .inner { + margin-top:5px; +} + +.toc-wrapper .inner a { + border: none; + box-shadow:none; +} + +.toc .h3-toc { + margin-left: .20in; +} +.toc .h4-toc { + margin-left: .35in; +} +.toc .h5-toc { + margin-left: .50in; +} +.toc .h6-toc { + margin-left: .65in; +} + +.toc-link a.anchor { + border:none; + margin-left: 5px; + box-shadow:none; +} \ No newline at end of file diff --git a/themes/clean/static.html.php b/themes/clean/static.html.php index 1472ae6..3f7b680 100644 --- a/themes/clean/static.html.php +++ b/themes/clean/static.html.php @@ -10,6 +10,7 @@ body; ?> +
diff --git a/themes/doks/css/style.css b/themes/doks/css/style.css index fda6a10..a005104 100644 --- a/themes/doks/css/style.css +++ b/themes/doks/css/style.css @@ -3533,3 +3533,49 @@ body.dark .docs-bar .menu-icon .navicon::before, body.dark .docs-bar .menu-icon .float-right { float:right; } + +summary { + display: list-item; + cursor: pointer; +} + +.toc-wrapper { + background: #f9f9f9; + border: 1px solid #aaa; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); + box-shadow: 0 1px 1px rgba(0,0,0,.05); + margin-bottom: 1.5em; + padding: 10px; + position: relative; + width: auto; + font-size: 90%; +} + +.toc-wrapper .inner { + margin-top:5px; +} + +.toc-wrapper .inner a { + border: none; + box-shadow:none; +} + +.toc .h3-toc { + margin-left: .20in; +} +.toc .h4-toc { + margin-left: .35in; +} +.toc .h5-toc { + margin-left: .50in; +} +.toc .h6-toc { + margin-left: .65in; +} + +.toc-link a.anchor { + border:none; + margin-left: 5px; + box-shadow:none; +} \ No newline at end of file diff --git a/themes/doks/js/toc.js b/themes/doks/js/toc.js index 4bdf27b..81ae07f 100644 --- a/themes/doks/js/toc.js +++ b/themes/doks/js/toc.js @@ -32,12 +32,6 @@ function htmlTableOfContents (documentRef) { headings.forEach(function (heading, index) { heading.setAttribute('id', 'toc-' + heading.textContent.replace(/\s+/g, '-').toLowerCase()); - var anchor = documentRef.createElement('a'); - anchor.setAttribute('href', '#toc-' + heading.textContent.replace(/\s+/g, '-').toLowerCase()); - anchor.setAttribute('class', 'anchor'); - anchor.setAttribute('aria-hidden', 'true'); - anchor.textContent = '#'; - var link = documentRef.createElement('a'); link.setAttribute('href', '#toc-' + heading.textContent.replace(/\s+/g, '-').toLowerCase()); link.textContent = heading.textContent; @@ -45,7 +39,6 @@ function htmlTableOfContents (documentRef) { var div = documentRef.createElement('div'); div.setAttribute('class', heading.tagName.toLowerCase() + '-toc'); - heading.appendChild(anchor); div.appendChild(link); toc.appendChild(div); }); diff --git a/themes/logs/css/style.css b/themes/logs/css/style.css index 937c94e..4611365 100644 --- a/themes/logs/css/style.css +++ b/themes/logs/css/style.css @@ -980,3 +980,49 @@ ul.archivegroup { .archivegroup li.expanded, .archivegroup li.collapsed { list-style: none; } + +summary { + display: list-item; + cursor: pointer; +} + +.toc-wrapper { + background: #f9f9f9; + border: 1px solid #aaa; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); + box-shadow: 0 1px 1px rgba(0,0,0,.05); + margin-bottom: 1.5em; + padding: 10px; + position: relative; + width: auto; + font-size: 90%; +} + +.toc-wrapper .inner { + margin-top:5px; +} + +.toc-wrapper .inner a { + border: none; + box-shadow:none; +} + +.toc .h3-toc { + margin-left: .20in; +} +.toc .h4-toc { + margin-left: .35in; +} +.toc .h5-toc { + margin-left: .50in; +} +.toc .h6-toc { + margin-left: .65in; +} + +.toc-link a.anchor { + border:none; + margin-left: 5px; + box-shadow:none; +} \ No newline at end of file diff --git a/themes/readable/css/style.css b/themes/readable/css/style.css index 5acf23d..cf4aca9 100644 --- a/themes/readable/css/style.css +++ b/themes/readable/css/style.css @@ -1030,4 +1030,50 @@ ul.archivegroup { .archivegroup li.expanded, .archivegroup li.collapsed { list-style: none; +} + +summary { + display: list-item; + cursor: pointer; +} + +.toc-wrapper { + background: #f9f9f9; + border: 1px solid #aaa; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); + box-shadow: 0 1px 1px rgba(0,0,0,.05); + margin-bottom: 1.5em; + padding: 10px; + position: relative; + width: auto; + font-size: 90%; +} + +.toc-wrapper .inner { + margin-top:5px; +} + +.toc-wrapper .inner a { + border: none; + box-shadow:none; +} + +.toc .h3-toc { + margin-left: .20in; +} +.toc .h4-toc { + margin-left: .35in; +} +.toc .h5-toc { + margin-left: .50in; +} +.toc .h6-toc { + margin-left: .65in; +} + +.toc-link a.anchor { + border:none; + margin-left: 5px; + box-shadow:none; } \ No newline at end of file diff --git a/themes/twentyfifteen/css/style.css b/themes/twentyfifteen/css/style.css index 0f1f7a4..1b1c9a0 100644 --- a/themes/twentyfifteen/css/style.css +++ b/themes/twentyfifteen/css/style.css @@ -6139,4 +6139,50 @@ ul.month { .feed-link a { height:100%; +} + +summary { + display: list-item; + cursor: pointer; +} + +.toc-wrapper { + background: #f9f9f9; + border: 1px solid #aaa; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); + box-shadow: 0 1px 1px rgba(0,0,0,.05); + margin-bottom: 1.5em; + padding: 10px; + position: relative; + width: auto; + font-size: 90%; +} + +.toc-wrapper .inner { + margin-top:5px; +} + +.toc-wrapper .inner a { + border: none; + box-shadow:none; +} + +.toc .h3-toc { + margin-left: .20in; +} +.toc .h4-toc { + margin-left: .35in; +} +.toc .h5-toc { + margin-left: .50in; +} +.toc .h6-toc { + margin-left: .65in; +} + +.toc-link a.anchor { + border:none; + margin-left: 5px; + box-shadow:none; } \ No newline at end of file diff --git a/themes/twentyfifteen/css/style_v2.css b/themes/twentyfifteen/css/style_v2.css index 322a3a5..dd9e2f1 100644 --- a/themes/twentyfifteen/css/style_v2.css +++ b/themes/twentyfifteen/css/style_v2.css @@ -6146,4 +6146,50 @@ ul.month { .feed-link a { height:100%; +} + +summary { + display: list-item; + cursor: pointer; +} + +.toc-wrapper { + background: #f9f9f9; + border: 1px solid #aaa; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); + box-shadow: 0 1px 1px rgba(0,0,0,.05); + margin-bottom: 1.5em; + padding: 10px; + position: relative; + width: auto; + font-size: 90%; +} + +.toc-wrapper .inner { + margin-top:5px; +} + +.toc-wrapper .inner a { + border: none; + box-shadow:none; +} + +.toc .h3-toc { + margin-left: .20in; +} +.toc .h4-toc { + margin-left: .35in; +} +.toc .h5-toc { + margin-left: .50in; +} +.toc .h6-toc { + margin-left: .65in; +} + +.toc-link a.anchor { + border:none; + margin-left: 5px; + box-shadow:none; } \ No newline at end of file diff --git a/themes/twentysixteen/css/style.css b/themes/twentysixteen/css/style.css index 15a6d33..0bcf421 100644 --- a/themes/twentysixteen/css/style.css +++ b/themes/twentysixteen/css/style.css @@ -4065,4 +4065,50 @@ ul.month { display:inline; margin:0 0 0 10px; float:right; +} + +summary { + display: list-item; + cursor: pointer; +} + +.toc-wrapper { + background: #f9f9f9; + border: 1px solid #aaa; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05); + box-shadow: 0 1px 1px rgba(0,0,0,.05); + margin-bottom: 1.5em; + padding: 10px; + position: relative; + width: auto; + font-size: 90%; +} + +.toc-wrapper .inner { + margin-top:5px; +} + +.toc-wrapper .inner a { + border: none; + box-shadow:none; +} + +.toc .h3-toc { + margin-left: .20in; +} +.toc .h4-toc { + margin-left: .35in; +} +.toc .h5-toc { + margin-left: .50in; +} +.toc .h6-toc { + margin-left: .65in; +} + +.toc-link a.anchor { + border:none; + margin-left: 5px; + box-shadow:none; } \ No newline at end of file