0

I was trying to add theme changing property in my react website, for that i used this method in scss file:`

$themes: (
  light: (
    textColor: #000,
    bg: white,
    logo: darkblue,
    bgSoft: #f6f3f3,
    textColorSoft: #555,
    border: lightgray,
  ),
  dark: (
    textColor: whitesmoke,
    bg: #222,
    logo: white,
    bgSoft: #333,
    textColorSoft: lightgray,
    border: #444,
  ),
);

@mixin themify($themes) {
  @each $theme, $map in $themes {
    .theme-#{$theme} & {
      $theme-map: () !global;
      @each $key, $submap in $map {
        $value: map-get(map-get($themes, $theme), "#{$key}");
        $theme-map: map-merge(
          $theme-map,
          (
            $key: $value,
          )
        ) !global;
      }
    @content;
    $theme-map: null !global;
    }
  }
}

@function themed($key) {
  @return map-get($theme-map, $key);
}

`

and then when i was trying to use this it was showing an error: Terminal photo of error

I don't understand why this is happening, please provide a solution as soon as possible.

Anonymous
  • 1
  • 1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Nov 16 '22 at 18:40
  • I just want to know that how can i remove this error, basically when i called the "themed" function (function shown in the above mentioned code) i start getting this error: SassError: $map: null is not a map – Anonymous Nov 17 '22 at 03:42

0 Answers0