Skip to content

Instantly share code, notes, and snippets.

@sthalik
Last active October 1, 2022 15:04
Show Gist options
  • Save sthalik/9842c2e273f7a060b5673296966c26e2 to your computer and use it in GitHub Desktop.
Save sthalik/9842c2e273f7a060b5673296966c26e2 to your computer and use it in GitHub Desktop.
/* ==UserStyle==
@name doc.magnum.graphics - 10/1/2022, 2:07:33 PM
@namespace github.com/openstyles/stylus
@version 1.0.0
@description A new userstyle
@author Me
==/UserStyle== */
@-moz-document domain("doc.magnum.graphics") {
/* even wider on 4K screens */
@media screen and (min-width: 1700px) {
.m-container {
width: 1300px;
}
}
/* sticky table of contents */
@media screen and (min-width: 1400px) {
main article nav:first-of-type {
position: fixed;
top: 0;
left: 0;
width: 300px;
height: 100%;
background-color: #293039;
z-index: 2002;
padding: .5rem 1rem;
}
main article nav:first-of-type ul {
padding-left: 1.5rem;
}
main article nav:first-of-type > ul {
padding-left: .5rem;
list-style: none;
}
header > nav > .m-container {
margin-left: 300px;
}
}
/* sticky top nav menu */
@media screen and (min-height: 651px) {
body > header > nav {
position: fixed;
top: 0;
width: 100%;
z-index: 2001;
}
main article:first-child {
padding-top: 3rem;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment