1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 07:36:44 +02:00

Plugins: Allow setting dark mode in css() (bug #1049)

This commit is contained in:
Jakub Vrana
2025-04-17 16:57:28 +02:00
parent d9c1ac00f3
commit 3dad86d279
5 changed files with 20 additions and 20 deletions

View File

@@ -79,7 +79,11 @@ class Adminer {
foreach (array("", "-dark") as $mode) {
$filename = "adminer$mode.css";
if (file_exists($filename)) {
$return[] = "$filename?v=" . crc32(file_get_contents($filename));
$file = file_get_contents($filename);
$return["$filename?v=" . crc32($file)] = ($mode
? "dark"
: (preg_match('~prefers-color-scheme:\s*dark~', $file) ? '' : 'light')
);
}
}
return $return;