lednerg

YouTube Stylesheet - Large "Show less" Button

Jul 27th, 2023 (edited)
1,286
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 3.13 KB | Source Code | 0 0
  1. /* ==UserStyle==
  2. @name           YouTube - Large "Show less" Button
  3. @namespace      lednerg
  4. @version        23.7.27
  5. @description    Turns the right half of the description box into a large "Show less" button.
  6. @author         lednerg
  7. ==/UserStyle== */
  8.  
  9. /*  I got tired of having to scroll down to find the "Show less" button, so I
  10.     made this. It lets you collapse the description box by clicking the right
  11.     half of it. The button itself becomes visible when hovering over it. Any
  12.     links on top of the button will remain clickable, text will be selectable. */
  13.  
  14. @-moz-document domain("youtube.com") {
  15.     /* "Show more" text */
  16.     ytd-watch-metadata[description-collapsed] tp-yt-paper-button#expand {
  17.         opacity: 0.2;
  18.         transition: opacity .5s;
  19.     }
  20.     /* "Show more" text when hovered */
  21.     ytd-watch-metadata[description-collapsed] #description:hover tp-yt-paper-button#expand {
  22.         opacity: 1;
  23.         transition: opacity .125s;
  24.     }
  25.     /* Puts some space before the "Show more" text */
  26.     ytd-watch-metadata[description-collapsed] tp-yt-paper-button#expand:before {
  27.         content: "   "
  28.     }
  29.     /* "Show less" button location, size, coloring, etc */
  30.     ytd-watch-metadata:not([description-collapsed]) tp-yt-paper-button#collapse {
  31.         color: transparent !important; /* hides original "Show less" text */
  32.         position: absolute !important;
  33.         bottom: 0% !important;
  34.         right: 0% !important;
  35.         height: 100%;
  36.         width: 50%;
  37.         opacity: 0.2;
  38.         transition: opacity .5s;
  39.         z-index: 0;
  40.         border-radius: 0;
  41.     }
  42.     /* "Show less" button when hovered */
  43.     ytd-watch-metadata:not([description-collapsed]) tp-yt-paper-button#collapse:hover {
  44.         background: linear-gradient(90deg, #9990 0%, #9992 22%, #9993 45%, #9993 55%, #9992 78%, #9990 100%);
  45.         transition: opacity .125s;
  46.         opacity: 1;
  47.     }
  48.     /* "Show less" text */
  49.     ytd-watch-metadata:not([description-collapsed]) tp-yt-paper-button#collapse:before {
  50.         color: #fff !important;
  51.         content: "Show less";
  52.         position: absolute;
  53.         bottom: 0;
  54.         text-align: center;
  55.         width: 100%;
  56.     }
  57.     /* "Show less" text when hovered */
  58.     ytd-watch-metadata:not([description-collapsed]) tp-yt-paper-button#collapse:hover:before {
  59.         opacity: 1 !important;
  60.         transition: opacity .25s;
  61.     }
  62.     /* Allows links, Chapters, Key Moments, etc to be clicked under "Show less" button*/
  63.     ytd-watch-metadata:not([description-collapsed]) #description a,
  64.     ytd-watch-metadata:not([description-collapsed]) #description span,
  65.     ytd-watch-metadata:not([description-collapsed]) #description .yt-formatted-string,
  66.     ytd-watch-metadata:not([description-collapsed]) div[slot="extra-content"] * {
  67.         position: relative !important;
  68.         z-index: 1 !important;
  69.     }
  70.     /* Move "Show less" down while open so it doesn't collide with text. */
  71.     ytd-watch-metadata:not([description-collapsed]) ytd-text-inline-expander {
  72.         min-height: 20px;
  73.         padding-bottom: 20px;
  74.         margin-top: -20px;
  75.         padding-top: 20px;
  76.     }
  77. }
Advertisement
Comments
Add Comment
Please, Sign In to add comment