Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Possible error in map-deep-merge function #262

Open
Danacus opened this issue Sep 10, 2021 · 1 comment · May be fixed by #263
Open

Possible error in map-deep-merge function #262

Danacus opened this issue Sep 10, 2021 · 1 comment · May be fixed by #263

Comments

@Danacus
Copy link

Danacus commented Sep 10, 2021

The function call to non-destructive-map-merge might have to be a recursive call to map-deep-merge.

} @else {
$result: map-merge(
$result,
(
$key: non-destructive-map-merge(map-get($result, $key), $value),
)
);
}
}

I believe this is why I can't create a custom dark theme if I try to edit one of the nested maps, like this for example:

$material-dark-theme: (
    'surface': #1d753a,
    'text': (
      'primary': material-color('shades', 'white'),
      'secondary': rgba(material-color('shades', 'white'), 0.7),
      'disabled': rgba(material-color('shades', 'white'), 0.5),
      'link': material-color('blue', 'accent-1'),
    ),
);

which results into the following error:

("primary": #ffffff, "secondary": rgba(255, 255, 255, 0.7), "disabled": rgba(255, 255, 255, 0.5), "link": #82b1ff) isn't a valid CSS value.
   ╷
27 │           $key: non-destructive-map-merge(map-get($result, $key), $value),
   │                                           ^^^^^^^^^^^^^^^^^^^^^^
   ╵
  node_modules/svelte-materialify/src/styles/tools/_functions.scss 27:43  map-deep-merge()
  node_modules/svelte-materialify/src/styles/_variables.scss 329:23       @import
  src/routes/__layout.svelte 2:11                                         root stylesheet
@Danacus
Copy link
Author

Danacus commented Sep 10, 2021

I can confirm that this is indeed the problem and changing the recursive call to the correct function name fixes the issue I was having.

@Danacus Danacus linked a pull request Sep 10, 2021 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant