Skip to content

Instantly share code, notes, and snippets.

@easrng
Last active October 2, 2023 21:33
Show Gist options
  • Save easrng/b038f78628ee5b95ee8d52d48df6b4e4 to your computer and use it in GitHub Desktop.
Save easrng/b038f78628ee5b95ee8d52d48df6b4e4 to your computer and use it in GitHub Desktop.
Nicer WebDAV listings in Firefox

Nicer WebDAV listings in Firefox

This CSS makes WebDAV listings look nicer in Firefox. Unfortunately it doesn't work right with userstyle addons, so you need to add it to your userContent.css file.

Before After
just a bunch of text in the default font running together with no line breaks or spaces a nicely-styled listing that's actually legible
How do I make a userContent.css file?
  • Open about:config and set toolkit.legacyUserProfileCustomizations.stylesheets to true
  • Open about:support, scroll down to Profile Directory, and click "Open Directory"
  • Make a folder named chrome if there isn't one already
  • Make a file in that folder named userContent.css
  • Put the css in that file
  • Restart Firefox
@namespace D url(DAV:);
D|* {
display: block;
color-scheme: dark light;
font-family: system-ui, sans-serif;
}
D|response {
margin: 1rem;
display: flex;
flex-direction: column;
}
D|response * {
display: none;
}
D|response D|propstat,
D|response D|prop {
display: contents;
}
D|response D|getcontentlength, D|response D|href, D|response D|getlastmodified {
display: block;
}
D|response D|href {
order: 1;
}
D|response D|getcontentlength {
order: 2;
}
D|response D|getlastmodified {
order: 3;
}
D|response D|getcontentlength, D|response D|getlastmodified {
color: GrayText;
}
D|response D|getlastmodified::before {
content: "Last modified ";
}
D|response D|getcontentlength::after {
content: " bytes";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment