From 9d138a96b94bc94ba761d2e9b91c2bfeabf84adf Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Sat, 8 Jun 2024 13:29:34 +0000 Subject: [PATCH] [dirlisting] Add dark mode support This adds dark mode support to lighttpd's dirlisting generated pages. Nowadays files transferred to browser via text/* MIME are also getting automatic dark mode by the browsers so this makes lighttpd's dirlisting compatible with those features of the browsers. --- src/mod_dirlisting.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mod_dirlisting.c b/src/mod_dirlisting.c index 2686cd3e4..9ad8d0a61 100644 --- a/src/mod_dirlisting.c +++ b/src/mod_dirlisting.c @@ -953,7 +953,14 @@ static void http_list_directory_header(request_st * const r, const handler_ctx * " color: #787878;" " padding-top: 4px;" "}\n" + "@media (prefers-color-scheme: dark) {\n" + " a, a:active {color: #9E9EFF;}\n" + " a:visited {color: #D0ADF0;}\n" + " body, div.list {background-color: transparent;}\n" + " div.foot {color: #878787;}\n" + "}\n" "\n" + "\n" )); }