lednerg

YouTube Stylesheet - Large "Show less" Button [Experimental]

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