Make Paragraphs Readable

Style paragraphs for better readability

  1. // ==UserScript==
  2. // @name Make Paragraphs Readable
  3. // @namespace http://tampermonkey.net/
  4. // @version 2025-05-14
  5. // @description Style paragraphs for better readability
  6. // @author You
  7. // @match *://*/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. function makeItReadable() {
  16. document.querySelectorAll('p').forEach(el => {
  17. Object.assign(el.style, {
  18. backgroundColor: '#fdf6e3',
  19. color: '#333333',
  20. fontFamily: 'Georgia, serif',
  21. fontSize: '18px',
  22. lineHeight: '1.6',
  23. maxWidth: '700px',
  24. margin: '2rem auto',
  25. padding: '0 1rem'
  26. });
  27. });
  28. }
  29.  
  30. // Create and style button
  31. const button = document.createElement('button');
  32. button.innerText = 'R';
  33. Object.assign(button.style, {
  34. position: 'fixed',
  35. top: '10px',
  36. left: '10px',
  37. zIndex: 9999,
  38. padding: '0px 12px',
  39. fontSize: '14px',
  40. backgroundColor: '#fdf6e3',
  41. color: '#333',
  42. border: '1px solid #ccc',
  43. borderRadius: '4px',
  44. cursor: 'pointer',
  45. opacity: 0.4
  46. });
  47. button.onclick = makeItReadable;
  48.  
  49. document.body.append(button);
  50. })();