Skip to content

Color variables override user's variables with the same name #5925

@JoannaFalkowska

Description

@JoannaFalkowska

The file discussed:
https://github.com/Dogfalo/materialize/blob/3bb2847f679b0e42f3adf4b30c04c6eb0adbbe28/sass/components/_color-variables.scss

Expected Behavior

Color variables are not overriding user's variables.

Current Behavior

Color variables are overriding user's variables.

Possible Solution

All variables, including color variables, should use !default flag.
Alternatively, color variables should be namespaced, for example with materialize_ prefix.

Steps to Reproduce (for bugs)

$red: #ff1111;
@import '../../node_modules/materialize-css/sass/components/color-variables';

(...)

.my-class {
  color: $red // bugs out because $red is now a map
}

Your Environment

  • Version used: 0.100.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions