Skip to content

Instantly share code, notes, and snippets.

@sharmaeklavya2
Created December 5, 2025 21:39
Show Gist options
  • Select an option

  • Save sharmaeklavya2/e8808872c4acd462d6cccff4ffa994c9 to your computer and use it in GitHub Desktop.

Select an option

Save sharmaeklavya2/e8808872c4acd462d6cccff4ffa994c9 to your computer and use it in GitHub Desktop.
nginx autoindex injected CSS
/* color scheme */
body {
--bg-color: white; --text-color: #202020; --link-color: #1a0dab; --vlink-color: #681da8; --tint: rgba(128,128,128,0.2);
}
@media (prefers-color-scheme: dark) {
body {
--bg-color: #1b1e20; --text-color: #c8c8c8; --link-color: #8ab4f8; --vlink-color: #c58af9;
}
}
/* basic */
body {
font-family: sans-serif;
margin: 0; padding: 1em 2.5em; line-height: 1.6; font-size: 1rem;
color: var(--text-color); background-color: var(--bg-color);
}
a:not(:hover) {text-decoration: none;}
a {color: var(--link-color);}
a:visited {color: var(--vlink-color);}
/* autoindex-specific */
body > h1 {
font-size: 2rem;
}
hr {
display: none;
}
body > pre {
font-size: 0;
display: inline-flex;
flex-direction: column;
/* color: transparent; */
}
body > pre > a {
font-size: 1.2rem;
padding: 0.25rem 1rem 0.25rem 0.4rem;
}
body > pre > a:hover, body > pre > a:focus {
background-color: var(--tint);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment