Discord/Shapes - Styles

Adjusting a few visual Elements on Discord

  1. // ==UserScript==
  2. // @name Discord/Shapes - Styles
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.5
  5. // @description Adjusting a few visual Elements on Discord
  6. // @author Vishanka
  7. // @match https://discord.com/channels/*
  8. // @grant none
  9. // @run-at document-idle
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Add custom CSS rule to modify the channel text area
  16. const style = document.createElement('style');
  17. style.innerHTML = `
  18. .channelTextArea_bdf0de {
  19. position: relative;
  20. width: 120%;
  21. text-indent: 0;
  22. border-radius: 8px;
  23. }
  24. .themedBackground_bdf0de {
  25. background: #2F2F2F;
  26. }
  27. .chatContent_a7d72e {
  28. position: relative;
  29. display: flex;
  30. flex-direction: column;
  31. min-width: 0;
  32. min-height: 0;
  33. flex: 1 1 auto;
  34. background: #212121 !important;
  35. }
  36.  
  37. .theme-dark .container_ee69e0 {
  38. background: #191919;
  39. }
  40. .theme-dark .themed_fc4f04 {
  41. background: #212121;
  42. }
  43. .wrapper_fea3ef {
  44.  
  45. background-color: #131313;
  46. }
  47. .footer_f8ec41 {
  48.  
  49. background: #131313;
  50. }
  51. .theme-dark .container_b2ca13 {
  52. background: #191919;
  53. }
  54. `;
  55. document.head.appendChild(style);
  56.  
  57. // Function to hide the targeted elements
  58. function hideElements() {
  59. // Select all elements that match the provided pattern
  60. const elements = document.querySelectorAll("[id^='message-accessories-'] > article > div > div > div.embedProvider_b0068a.embedMargin_b0068a, [id^='message-accessories-'] > article > div > div > div.embedTitle_b0068a.embedMargin_b0068a, .buttons_bdf0de .expression-picker-chat-input-button.buttonContainer_bdf0de, .channelAppLauncher_df39bd .buttonContainer_df39bd.app-launcher-entrypoint");
  61.  
  62. // Iterate over each element and hide it
  63. elements.forEach(element => {
  64. element.style.display = 'none';
  65. });
  66. }
  67.  
  68. // Run the function initially to hide elements present at page load
  69. hideElements();
  70.  
  71. // Observe mutations to the DOM and hide elements when new ones are added
  72. const observer = new MutationObserver(hideElements);
  73. observer.observe(document.body, { childList: true, subtree: true });
  74. })();