mirror of
https://github.com/openwrt/luci.git
synced 2026-06-17 12:40:24 +04:00
54338546bc
Add dark mode following the luci-theme-bootstrap pattern: auto-detect via prefers-color-scheme, with forced MaterialDark/MaterialLight variants. Replace ~60 hardcoded colors in cascade.css with CSS variables and override them in a :root[data-darkmode="true"] block. Signed-off-by: Shannon Barber <sgbarber@gmail.com>
29 lines
476 B
Bash
Executable File
29 lines
476 B
Bash
Executable File
#!/bin/sh
|
|
|
|
changed=0
|
|
|
|
set_opt() {
|
|
local key=$1
|
|
local val=$2
|
|
|
|
if ! uci -q get "luci.$key" 2>/dev/null; then
|
|
uci set "luci.$key=$val"
|
|
changed=1
|
|
fi
|
|
}
|
|
|
|
set_opt themes.Material /luci-static/material
|
|
|
|
if [ "$PKG_UPGRADE" != 1 ] && [ $changed = 1 ]; then
|
|
set_opt main.mediaurlbase /luci-static/material
|
|
fi
|
|
|
|
set_opt themes.MaterialDark /luci-static/material-dark
|
|
set_opt themes.MaterialLight /luci-static/material-light
|
|
|
|
if [ $changed = 1 ]; then
|
|
uci commit luci
|
|
fi
|
|
|
|
exit 0
|