Advertisement
Guest User

Reddit Spoiler CSS Code

a guest
Jan 27th, 2016
866
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 3.03 KB | None | 0 0
  1. /* Instructions to Configure:
  2.  
  3. 1) Add new link flair template with CSS class of "spoiler" (without quotes) and a flair text of "Spoilers" (Be sure to save!)
  4.  
  5. 2) Add this Pastebin entry into your subreddit's CSS
  6.  
  7. 3) Make sure "allow submitters to assign their own link flair" and "enable user flair in this subreddit" are checked and a valid link flair position is set. Be sure to save the options!
  8.  
  9. 4) Upload a 70x70 image named "spoiler-image" (without quotes) to be the spoiler icon. If you don't want to make one, you can get one at https://j-co.ga/spoiler.png
  10.  
  11. 5) Tell everyone to apply the flair for spoilers.
  12.  
  13. You can see a demo of this in action at /r/SpoilerCSSTesting */
  14.  
  15. /* Start Spoiler CSS */
  16. /* Updated on January 27th, 2016 at 22:30 UTC. */
  17.  
  18. .linkflair-spoiler a.title:before {
  19.     color: teal!important;
  20.     text-shadow: 0 0 0px teal!important;
  21.     content: "Spoiler: ";
  22. }
  23.  
  24. .linkflair-spoiler a.title {
  25.    color: transparent!important;
  26.    text-shadow: 0 0 7px teal!important;
  27. }
  28. .linkflair-spoiler a.title:visited {
  29.     color: teal!important;
  30.     text-shadow: 0 0 0px teal!important;
  31.     visibility: visible!important;
  32. }
  33. .linkflair-spoiler a.title:hover {
  34.     color: teal!important;
  35.     text-shadow: 0 0 0px teal!important;
  36.     visibility: visible!important;
  37. }
  38.  
  39. .linkflair-spoiler:hover {
  40.     text-shadow: 0 0 0px teal;
  41.     visibility: visible!important;
  42. }
  43.  
  44. .linkflair-spoiler .thumbnail img { display: none }
  45.  
  46. .linkflair-spoiler .linkflairlabel {
  47.     background: transparent;
  48.     border-color: teal;
  49.     color: teal;
  50.     text-transform: uppercase;
  51. }
  52.  
  53. .linkflair-spoiler .thumbnail {
  54.     background-image: url(%%spoiler-image%%);
  55.     background-position: 0px 0px;
  56.     width: 70px;
  57.     height: 70px;
  58. }
  59.  
  60. a[href|="#spoiler"],a[href|="#spoiler"],body:lang(bc) a[href|="#spoiler"],body:lang(bc) a[href|="#spoiler"] {
  61.     text-shadow: 0 0 7px teal;
  62.     color: transparent!important;
  63.     cursor: text;
  64. }
  65.  
  66. a[href|="#spoiler"]:before,a[href|="#spoiler"]:before,body:lang(bc) a[href|="#spoiler"]:before,body:lang(bc) a[href|="#spoiler"]:before {
  67.     text-shadow: 0 0 0px teal;
  68.     color: teal;
  69.     content: "Spoiler: ";
  70.     cursor: text;
  71. }
  72.  
  73. a:hover[href|="#spoiler"],a:hover[href|="#spoiler"],body:lang(bc) a:hover[href|="#spoiler"],body:lang(bc) a:hover[href|="#spoiler"] {
  74.     text-shadow: 0 0 0px teal;
  75.     color: teal;
  76.     cursor: text;
  77. }
  78.  
  79. a[href|="/spoiler"],a[href|="/spoiler"],body:lang(bc) a[href|="/spoiler"],body:lang(bc) a[href|="/spoiler"] {
  80.     text-shadow: 0 0 7px teal;
  81.     color: transparent!important;
  82.     cursor: text;
  83. }
  84.  
  85. a[href|="/spoiler"]:before,a[href|="/spoiler"]:before,body:lang(bc) a[href|="/spoiler"]:before,body:lang(bc) a[href|="/spoiler"]:before {
  86.     text-shadow: 0 0 0px teal;
  87.     color: teal;
  88.     content: "Spoiler: ";
  89.     cursor: text;
  90. }
  91.  
  92. a:hover[href|="/spoiler"],a:hover[href|="/spoiler"],body:lang(bc) a:hover[href|="/spoiler"],body:lang(bc) a:hover[href|="/spoiler"] {
  93.     text-shadow: 0 0 0px teal;
  94.     color: teal;
  95.     cursor: text;
  96. }
  97.  
  98.  
  99. /* End Spoiler CSS */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement