Just to follow up on my previous comment, adding the following CSS to any page on docs.rs does the trick
.small-section-header {
position: sticky;
top: 0;
z-index: 2;
background-color: #353535;
}
Naturally, the background-color
will need to change alongside the theme. The expand/collapse button is still visible underneath this, as the element doesn't sit far enough to the left. But as a quick fix, this little snippet of code suffices (and in my opinion is actually far better).