12 foreach (
$css_vars as $color_scheme => $css_variables) {
14 foreach ($css_variables as $variable =>
$value) {
15 $scheme_vars .=
"--elgg-{$variable}: {$value};";
18 $variables_output =
'';
19 if ($color_scheme ===
'dark') {
21 $variables_output .=
'color-scheme: dark;';
24 $variables_output .=
'body {' . $scheme_vars .
'}';
27 echo
":root[data-color-scheme={$color_scheme}] {";
28 echo $variables_output;
32 if ($color_scheme ===
'dark') {
33 echo
'@media (prefers-color-scheme: dark) {';
34 echo
':root:not([data-color-scheme]) {';
35 echo $variables_output;
if(!elgg_get_config('color_schemes_enabled')) $css_vars
elgg_get_config(string $name, $default=null)
Get an Elgg configuration value.
_elgg_services()
Get the global service provider.