Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有需要添加打印时隐藏功能哇 #7

Closed
maboloshi opened this issue Oct 29, 2021 · 3 comments
Closed

有需要添加打印时隐藏功能哇 #7

maboloshi opened this issue Oct 29, 2021 · 3 comments

Comments

@maboloshi
Copy link

我本地添加了 打印时隐藏的功能

@@ -446,6 +446,7 @@
 .is-active-link::before {
   background-color: var(--toc-bar-active-color);
 }
+@media print { .no-print, .no-print * { display: none !important; } }
 /* end tocbot related */
 `

@@ -464,7 +465,7 @@

     this.element = document.createElement('div')
     this.element.id = 'toc-bar'
-    this.element.classList.add('toc-bar')
+    this.element.classList.add('toc-bar', 'no-print')
     document.body.appendChild(this.element)

     /** @type {Boolean} */
@hikerpig
Copy link
Owner

@maboloshi 求问下为啥需要加 .no-print * 这个?好像没有也能达到效果的

@maboloshi
Copy link
Author

是的 忘了删掉了

@hikerpig
Copy link
Owner

我领会这个精神,加进去了。感谢宝贵的反馈 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants