Skip to content

Commit

Permalink
[dirlisting] Add dark mode support
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ebraminio committed Jun 8, 2024
1 parent 38fe272 commit b10c767
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mod_dirlisting.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
" div.foot {color: #878787;}\n"
" body, div.list {background-color: transparent;}\n"
"}\n"
"</style>\n"
"<meta name=\"color-scheme\" content=\"light dark\">\n"
));
}

Expand Down

0 comments on commit b10c767

Please sign in to comment.