Advertisement
Guest User

Danbooru: floating sidebar

a guest
Mar 18th, 2013
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 2.17 KB | None | 0 0
  1. @-moz-document domain("donmai.us") {
  2. /* This style changes the Danbooru image sidebar from a regular part of page content */
  3. /*  to a fixed presence, staying put even when you scroll around a large image.      */
  4. /* It has been designed to work with the Small Mode base style; it's mostly untested */
  5. /*  as a standalone style alteration.  In particular, sizes may need adjustment if   */
  6. /*  Small Mode's font reductions are not in effect.                                  */
  7.  
  8. /* This style works very nicely in conjunction with the "collapsed sidebar" option.  */
  9.  
  10. /* Last updated 2013-03-19 by kounishin                           */
  11. /* May break if/when Danbooru page styles change after that date. */
  12. /* 2013-03-19: section#content now uses primarily margin, only a little */
  13. /*   padding; this style and the collapsed sidebar updated accordingly. */
  14.  
  15. /* fixed height is a hack to be able to scroll for posts with many tags, and means   */
  16. /*  that visible news or notices will push part of it off the visible page; however, */
  17. /*  that's okay, since most users will close the notices.                            */
  18. aside#sidebar {
  19.   position: fixed !important;
  20.   z-index: 1800 !important;  /* Danbooru 2.1 has translation notes at z-index: 1500; this needs to be above that. */
  21.   max-height: 100% !important;
  22.   overflow-x: hidden !important;
  23.   overflow-y: auto !important;
  24. }
  25.  
  26. /* background colour is overridable by collapsed-sidebar style or the like, so less specific */
  27. #sidebar {
  28.   background-color: rgba(255,255,255,0.3) !important;
  29. }
  30.  
  31. /* ensure that the search form doesn't wrap if a scrollbar appears */
  32. #search-box {
  33.   white-space: nowrap !important;
  34. }
  35.  
  36. /* Adjust content area on pages with sidebar to allow for it.    */
  37. /* Default sidebar width is 15, but there are both margins and   */
  38. /*  padding involved, which makes things trickier.               */
  39. /* For me, padding by 14.7em leaves the page content in exactly  */
  40. /*  same place it was before, but 13.5em with reduced padding    */
  41. /*  gets rid of some extra whitespace and overall looks better.  */
  42. #sidebar + #content {
  43.   margin-left: 13.5em !important;
  44.   padding-left: 0.3em !important;
  45. }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement