Skip to content

Commit 646e71c

Browse files
committed
[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.
1 parent 38fe272 commit 646e71c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/mod_dirlisting.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,14 @@ static void http_list_directory_header(request_st * const r, const handler_ctx *
953953
" color: #787878;"
954954
" padding-top: 4px;"
955955
"}\n"
956+
"@media (prefers-color-scheme: dark) {\n"
957+
" a, a:active {color: #9E9EFF;}\n"
958+
" a:visited {color: #D0ADF0;}\n"
959+
" div.foot {color: #878787;}\n"
960+
" body, div.list {background-color: transparent;}\n"
961+
"}\n"
956962
"</style>\n"
963+
"<meta name=\"color-scheme\" content=\"light dark\">\n"
957964
));
958965
}
959966

0 commit comments

Comments
 (0)