Search code examples
cssdocumentationread-the-docs

why doesn't CSS file work in readthedocs?


I have a documentation for my app in readthedocs website. And I have a .css file that changes side bar appearance. About three month ago this .css file worked well, but now it doesn't. Here is the link.
That is how it looked like:
enter image description here

That is how it looks now:
enter image description here

The .css file:

/* Fixes the size of the RTD flyout */
/* .rst-versions {
    width: 320px !important;
} */

/* Content area color */
.wy-nav-content {
    background: #dddddd;
}

/* Scroll Bar*/
.wy-side-scroll {
    width: auto;
    overflow-y: auto;
    margin-top: 0px;
}

/* width of the side panel */
.wy-nav-side {
    width: 320px;
}

/* content section full screen */
.wy-nav-content {
   max-width: none; 
}

/* set color of left side bar */
.wy-nav-side,.wy-side-nav-search,.wy-nav-top {
    /*background: #0079c1; /*005eb8 */
   background: #006464;
}

/* Change caption color to be more legible */
.wy-menu > .caption > span.caption-text {
   color: #ffcccc;
   font-size: 20px;
}

/* Change the version color to match caption color */
.wy-side-nav-search>div.version {
   color: #ffcccc;
}

/* Get rid of that ugly yellow highlight color and replace with something more appealing to the eye */
.highlight .hll {
   background-color: #fcfcfc;
}
/* 
@media screen and (max-width: 768px) {
    .wy-nav-content-wrap {
        margin-left: 0px;
    }
    .wy-nav-side {
        width: 500px;
    }
} */

What could be the reason of this? Thanks!


Solution

  • I partially confirm what @Steve Piercy says in the comment. The rule .wy-menu > .caption > span.caption-text { doesn't work anymore, since the <p> that surrounds the <span class="caption-text"> no longer has a caption class. You can check that by comparing latest with 1.3.4-branch.

    However, as you can see from the build logs (old, new), the problem is not with sphinx-rtd-theme (you are using 0.5.0 in both), but the docutils version (0.16 in the old build, 0.17 in the new build). You will need to either upgrade your Sphinx version, or downgrade docutils.