Reddit: Hide Sidebar When 50% Screen

Hide Reddit sidebar when window is less than 960px wide.

当前为 2017-03-16 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Reddit: Hide Sidebar When 50% Screen
  3. // @namespace https://github.com/Zren/
  4. // @description Hide Reddit sidebar when window is less than 960px wide.
  5. // @icon https://reddit.com/favicon.ico
  6. // @author Zren
  7. // @version 1
  8. // @match https://www.reddit.com/*
  9. // @run-at document-start
  10. // @grant GM_addStyle
  11. // ==/UserScript==
  12.  
  13. var css = [
  14. "@media (min-width: 1px) and (max-width: 960px) {",
  15. " html .side {",
  16. " display: none;",
  17. " }",
  18. " html .sitetable,",
  19. " html .thing,",
  20. " html .linklisting .link,",
  21. " html div.content,",
  22. " html .commentarea,",
  23. " html .commentarea>.sitetable>.comment {",
  24. " margin-left: 0 !important;",
  25. " margin-right: 0 !important;",
  26. " max-width: 100vw;",
  27. " padding-left: 0 !important;",
  28. " padding-right: 0 !important;",
  29. " }",
  30. " body > .content { border-right: 1px; }",
  31. "}",
  32. ];
  33.  
  34. GM_addStyle(css.join('\n'));