Skip to content

Dark theme elevation feature overrides custom background colors #1075

@rafaelbrier

Description

@rafaelbrier

The SASS variable of some components are being overridden when using dark Theme.
image

  1. Look, the image shows a style ".dark-theme .rmd-toast" where the variable "--rmd-theme-background" are being set again for some reason.

  2. Below at the class ".dark-theme" i globally defined that variable.

  3. The code that i use for theme switch:

// Uses System Preference
@media (prefers-color-scheme: dark) {
    :root {
        @include rmd-theme-dark;
    }
}

@media (prefers-color-scheme: light) {
    :root {
        @include rmd-theme-light;
    }
}

// Class for global theme change
.dark-theme {
    @include rmd-theme-dark;
}

.light-theme {
    @include rmd-theme-light;
}

What is the expected behavior?

The variable should not be overridden in the dark theme.

A little about versions:
Windows
Chrome
"react-md": "^2.5.3"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions