Skip to content

Commit 7b3b149

Browse files
committed
feat: hide toc-bar in print mode, close #7
1 parent 6499839 commit 7b3b149

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

toc-bar.user.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,10 @@ a.toc-link {
446446
.is-active-link::before {
447447
background-color: var(--toc-bar-active-color);
448448
}
449+
450+
@media print {
451+
.toc-bar__no-print { display: none !important; }
452+
}
449453
/* end tocbot related */
450454
`
451455

@@ -464,7 +468,7 @@ a.toc-link {
464468

465469
this.element = document.createElement('div')
466470
this.element.id = 'toc-bar'
467-
this.element.classList.add('toc-bar')
471+
this.element.classList.add('toc-bar', 'toc-bar__no-print')
468472
document.body.appendChild(this.element)
469473

470474
/** @type {Boolean} */

0 commit comments

Comments
 (0)