Collapse/Expand section with paragraphs

This commit is contained in:
yeheshuah 2025-04-30 15:43:44 +09:00
parent c3bec6f888
commit 301e5dd7ea
2 changed files with 14 additions and 4 deletions

View File

@ -4,6 +4,8 @@ document.addEventListener('DOMContentLoaded', function () {
if (!summary) return; if (!summary) return;
if (window.matchMedia('(hover: none)').matches) return;
let linkEl; let linkEl;
details.addEventListener('mouseenter', () => { details.addEventListener('mouseenter', () => {

View File

@ -145,6 +145,10 @@ ol li::marker {
font-weight: bold; font-weight: bold;
} }
[dir=ltr] .md-typeset summary {
padding-right: 80px;
}
.md-typeset summary:after { .md-typeset summary:after {
background-color: unset; background-color: unset;
content: " Expand ▼"; content: " Expand ▼";
@ -158,15 +162,17 @@ ol li::marker {
-webkit-mask-size: unset; -webkit-mask-size: unset;
mask-size: unset; mask-size: unset;
position: absolute; position: absolute;
top: unset; top: 8px;
transform: unset; transform: unset;
transition: unset; transition: unset;
width: unset; width: 80px;
text-align: right;
} }
.md-typeset details[open]>summary:after { .md-typeset details[open]>summary:after {
transform: unset; transform: unset;
content: " Collapse ▲"; content: " Collapse ▲";
width: 80px;
} }
.md-typeset details:not([open]) { .md-typeset details:not([open]) {
@ -190,6 +196,8 @@ ol li::marker {
text-decoration: none; text-decoration: none;
} }
.hoverlink:hover { @media (hover: hover) {
.hoverlink:hover {
text-decoration: none; text-decoration: none;
}
} }