Change Background Color for All Sites (dark red)

Change background color while preserving other styles

  1. // ==UserScript==
  2. // @name Change Background Color for All Sites (dark red)
  3. // @namespace https://greasyfork.org/en/users/1200587-trilla-g
  4. // @version 1.6
  5. // @description Change background color while preserving other styles
  6. // @author Trilla_G
  7. // @match *://*/*
  8. // @grant GM_addStyle
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. GM_addStyle(`
  13. /* General background elements */
  14. body, html, #content, main, .main-container, .page-wrapper, .site-wrapper,
  15. .content-wrapper, .app-root, [class*="background"] {
  16. background-color: #943022 !important;
  17. }
  18.  
  19. /* Ensure text and foreground colors are not overridden */
  20. * {
  21. background-color: transparent !important;
  22. }
  23.  
  24. /* Restore background for pop-up elements */
  25. .popup, .popover, .modal, .tooltip, .menu, .dropdown, .overlay,
  26. .dialog, .floating-menu, .context-menu, [role="dialog"], [role="menu"],
  27. [role="tooltip"], [role="alert"], [aria-modal="true"] {
  28. background-color: #643022 !important; /* Darker red to match theme */
  29. color: inherit !important;
  30. }
  31.  
  32. /* YouTube-specific backgrounds */
  33. ytd-app, ytd-page-manager {
  34. background-color: #943022 !important;
  35. }
  36.  
  37. /* Rumble backgrounds */
  38. .app, .wrapper, .main-content {
  39. background-color: #943022 !important;
  40. }
  41.  
  42. /* Kick backgrounds */
  43. .kick-app-root, .video-player-page, .page-content {
  44. background-color: #943022 !important;
  45. }
  46.  
  47. /* Twitch navigation, sidebar, and headers */
  48. .tw-root, .tw-sidebar, .side-nav__content, .top-nav__menu, .chat-room,
  49. .channel-page__container, [data-a-target="side-nav-bar"], .tw-transition-group,
  50. .side-nav__scrollable_content {
  51. background-color: #943022 !important;
  52. }
  53.  
  54. /* ChatGPT background fix */
  55. .chatgpt-app, .flex.flex-col.items-center, #__next {
  56. background-color: #943022 !important;
  57. }
  58.  
  59. /* X (formerly Twitter) background and containers */
  60. [data-testid="primaryColumn"], [data-testid="secondaryColumn"],
  61. header[role="banner"], div[aria-label="Timeline: Home"],
  62. [role="main"] {
  63. background-color: #943022 !important;
  64. }
  65.  
  66. /* Remove semi-transparent overlays */
  67. [style*="rgba"], [style*="opacity"] {
  68. background: none !important;
  69. opacity: 1 !important;
  70. }
  71. `);
  72.