Moin
December 14, 2024, 12:37pm
12
Does tbe way the versatile banner changes the background work? You could install the component, add a background image for dark mode and try by using the preview.
Then you could use dark-light-choose
which was for example explained in Update themes and plugins to support automatic dark mode - #5 by pmusaraj and is also used for the banner
@function dark-if-set($dark, $light) {
@if $dark != "" {
@return $dark;
} @else {
@return $light;
}
}
$bg-color: dark-light-choose(
$background_color,
dark-if-set($background_color_dark, $background_color)
);
$primary-text: dark-light-choose(
$primary_text_color,
dark-if-set($primary_text_color_dark, $primary_text_color)
);
$secondary-text: dark-light-choose(
$secondary_text_color,
dark-if-set($secondary_text_color_dark, $secondary_text_color)
);
This file has been truncated. show original
2 Likes