Skip to content

Instantly share code, notes, and snippets.

@squaresmile
Created April 18, 2020 00:45
Show Gist options
  • Save squaresmile/47ed504ba2838f51be451518af5bd6c1 to your computer and use it in GitHub Desktop.
Save squaresmile/47ed504ba2838f51be451518af5bd6c1 to your computer and use it in GitHub Desktop.
Hide Reddit Sidebar Userstyles
@-moz-document domain("reddit.com") {
@namespace url(http://www.w3.org/1999/xhtml);
/* To change the maximum size of the window where the sidebar hides itself
change max-width */
@media (max-width: 1500px) {
.side:not(:hover){
/* You can change the width of the sidebar when hidden */
width: 30px ;
height: 100%;
display: block;
position: fixed ;
margin: 0 ;
padding: 0 ;
top: 0 ;
right: 0 ;
/* change opacity of the sidebar when hidden
min: 0 (invisible) max: 1 (solid) */
opacity: 0.05;
background-color: #000 ;
color: #000 ;
z-index: 2;
}
/* hides all the things inside the sidebar when hidden */
.side:not(:hover) > * {
display: none ;
opacity: 0 ;
position: fixed ;
}
/* some subreddit styles leave a space on the side for the sidebar
we want it to fill up the whole area */
.side:not(:hover) ~ .content{
margin-left: 16px;
margin-right: 16px;
}
/* some subreddit styles have fancy things. We don't want them to intefere */
.side:not(:hover):before{
content: none;
}
.side:not(:hover):after{
content: none;
}
.side, .side .spacer {
/* smoother sliding. You can change the time to make it slide quicker or slower
default: 0.5s */
transition: all 0.5s ease;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment