- PostgreSQL: Display description of system variables
- PostgreSQL: Avoid warning about crdb_version (bug #924, regression from 5.0.5)
- CSS: Sticky table headers (bug #918)
+- CSS: Allow more custom styles with dark mode (bug #925)
- IMAP: New plugin driver created for fun
## Adminer 5.0.6 (released 2025-03-17)
<link rel="stylesheet" href="../adminer/static/default.css">
<?php
$css = $adminer->css();
- $dark = (count($css) == 1 ? !!preg_match('~-dark~', $css[0]) : null);
+ $has_dark = in_array("adminer-dark.css", $css);
+ $dark = (in_array("adminer.css", $css)
+ ? ($has_dark ? null : false) // both styles - autoswitching, only adminer.css - light
+ : ($has_dark ?: null) // only adminer-dark.css - dark, neither - autoswitching
+ );
if ($dark !== false) {
echo "<link rel='stylesheet'" . ($dark ? "" : " media='(prefers-color-scheme: dark)'") . " href='../adminer/static/dark.css'>\n";
}