Loading src/theme.cpp +14 −3 Changes for src/theme.cpp: 14 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -632,7 +632,7 @@ void blogi::Theme::injectThemeColors(const int tid, libhtmlpp::HtmlElement *inde libhtmlpp::HtmlString css; css << "<style>"; // Dark scheme (default) — :root for dark-first, plus media query // Dark scheme (default) css << ":root{"; for(auto &v : vars){ std::string val; Loading @@ -643,9 +643,20 @@ void blogi::Theme::injectThemeColors(const int tid, libhtmlpp::HtmlElement *inde } css << "color-scheme:dark;}"; // Light scheme via prefers-color-scheme // Light scheme — explicit data-theme="light" std::string lightPrefix = "THEME_LIGHT_"; css << "@media(prefers-color-scheme:light){:root{"; css << ":root[data-theme=\"light\"]{"; for(auto &v : vars){ std::string val; try { getConfig(*_Config.TDatabase[tid], lightPrefix + v.dbSuffix, val); } catch(...) {} normalizeColor(val); if(val.empty()) val = v.lightDefault; css << v.cssVar << ":" << val.c_str() << ";"; } css << "color-scheme:light;}"; // Light scheme — OS preference (auto mode) css << "@media(prefers-color-scheme:light){:root:not([data-theme=\"dark\"]){"; for(auto &v : vars){ std::string val; try { getConfig(*_Config.TDatabase[tid], lightPrefix + v.dbSuffix, val); } catch(...) {} Loading Loading
src/theme.cpp +14 −3 Changes for src/theme.cpp: 14 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -632,7 +632,7 @@ void blogi::Theme::injectThemeColors(const int tid, libhtmlpp::HtmlElement *inde libhtmlpp::HtmlString css; css << "<style>"; // Dark scheme (default) — :root for dark-first, plus media query // Dark scheme (default) css << ":root{"; for(auto &v : vars){ std::string val; Loading @@ -643,9 +643,20 @@ void blogi::Theme::injectThemeColors(const int tid, libhtmlpp::HtmlElement *inde } css << "color-scheme:dark;}"; // Light scheme via prefers-color-scheme // Light scheme — explicit data-theme="light" std::string lightPrefix = "THEME_LIGHT_"; css << "@media(prefers-color-scheme:light){:root{"; css << ":root[data-theme=\"light\"]{"; for(auto &v : vars){ std::string val; try { getConfig(*_Config.TDatabase[tid], lightPrefix + v.dbSuffix, val); } catch(...) {} normalizeColor(val); if(val.empty()) val = v.lightDefault; css << v.cssVar << ":" << val.c_str() << ";"; } css << "color-scheme:light;}"; // Light scheme — OS preference (auto mode) css << "@media(prefers-color-scheme:light){:root:not([data-theme=\"dark\"]){"; for(auto &v : vars){ std::string val; try { getConfig(*_Config.TDatabase[tid], lightPrefix + v.dbSuffix, val); } catch(...) {} Loading