CSS: twitter.com

Corrections to UI of twitter.com

当前为 2023-09-18 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name CSS: twitter.com
  3. // @description Corrections to UI of twitter.com
  4. // @author MK
  5. // @namespace max44
  6. // @homepage https://greasyfork.org/en/users/309172-max44
  7. // @match *://*.twitter.com/*
  8. // @icon https://www.google.com/s2/favicons?domain=twitter.com
  9. // @version 1.1.4
  10. // @license MIT
  11. // @run-at document-idle
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. //CSS for any mode
  16. var css = `
  17. /*No opacity for header*/
  18. .r-6026j { /*white UI*/
  19. background-color: rgba(255, 255, 255, 1) !important;
  20. }
  21. .r-ii8lfi { /*dim UI*/
  22. background-color: rgba(21, 32, 43, 1) !important;
  23. }
  24. .r-5zmot { /*lights out UI*/
  25. background-color: rgba(0, 0, 0, 1) !important;
  26. }
  27. .r-1e5uvyk {
  28. backdrop-filter: none !important;
  29. }
  30. /*Add bottom border to header*/
  31. main[role="main"] div[data-testid="primaryColumn"] > div[tabindex="0"] > div, /*Desktop browser*/
  32. div[data-testid="TopNavBar"] { /*Mobile browser*/
  33. border-bottom-width: 1px !important;
  34. border-bottom-style: solid !important;
  35. border-bottom-color: rgb(239, 243, 244) !important;
  36. }
  37. /*No opacity for floating button in mobile twitter*/
  38. div#layers aside > div[data-testid="FloatingActionButtonBase"] {
  39. opacity: 1 !important;
  40. }
  41. /*No opacity for bottom bar in mobile twitter*/
  42. div#layers div[data-testid="BottomBar"] {
  43. opacity: 1 !important;
  44. }
  45. .r-1i6wzkk {
  46. transition-property: unset !important;
  47. }
  48. `;
  49.  
  50. if (typeof GM_addStyle != 'undefined') {
  51. GM_addStyle(css);
  52. } else if (typeof PRO_addStyle != 'undefined') {
  53. PRO_addStyle(css);
  54. } else if (typeof addStyle != 'undefined') {
  55. addStyle(css);
  56. } else {
  57. var node = document.createElement('style');
  58. node.type = 'text/css';
  59. node.appendChild(document.createTextNode(css));
  60. document.documentElement.appendChild(node);
  61. }
  62. })();