YouTube Grid Column Customizer

Adjust the number of video columns on YouTube

  1. // ==UserScript==
  2. // @name YouTube Grid Column Customizer
  3. // @namespace https://violentmonkey.github.io/
  4. // @version 0.2
  5. // @description Adjust the number of video columns on YouTube
  6. // @author Bui Quoc Dung
  7. // @match https://www.youtube.com/*
  8. // @grant GM_addStyle
  9. // ==/UserScript==
  10. (function () {
  11. "use strict";
  12.  
  13. GM_addStyle(`
  14. /* Mặc định: 3 cột */
  15. ytd-rich-grid-renderer {
  16. --ytd-rich-grid-items-per-row: 3 !important;
  17. }
  18.  
  19. /* Desktop lớn */
  20. @media (min-width: 1200px) {
  21. ytd-rich-grid-renderer {
  22. --ytd-rich-grid-items-per-row: 4 !important;
  23. }
  24. }
  25.  
  26. /* Tablet nhỏ hơn */
  27. @media (max-width: 800px) {
  28. ytd-rich-grid-renderer {
  29. --ytd-rich-grid-items-per-row: 2 !important;
  30. }
  31. }
  32. `);
  33. })();