Skip to content

[Colors and theming] - Exception: "$color of red($color) must be a color" for certain colors #884

Description

@Kaishiyoku

When I'm trying to adjust the color theme sometimes I get an exception on SCSS compile-time:

ERROR in ./resources/sass/app.scss
Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: argument `$color` of `red($color)` must be a color
        on line 100 of node_modules/@react-md/theme/dist/_color-a11y.scss, in function `red`
        from line 100 of node_modules/@react-md/theme/dist/_color-a11y.scss, in function `rmd-theme-luminance`
        from line 118 of node_modules/@react-md/theme/dist/_color-a11y.scss, in function `rmd-theme-contrast`
        from line 138 of node_modules/@react-md/theme/dist/_color-a11y.scss, in function `rmd-theme-tone`
        from line 84 of node_modules/@react-md/chip/dist/_variables.scss, in function `if`
        from line 83 of node_modules/@react-md/chip/dist/_variables.scss
        from line 6 of node_modules/@react-md/chip/dist/_functions.scss
        from line 12 of node_modules/@react-md/chip/dist/_mixins.scss
        from line 7 of node_modules/react-md/dist/_react-md.scss
        from line 6 of XXX\resources\sass\app.scss
>> ed: nth($rmd-theme-linear-channel-values, red($color) + 1);

   ------------------------------------------^

    at XXX\node_modules\webpack\lib\NormalModule.js:316:20
    at XXX\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at XXX\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at context.callback (XXX\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at Object.callback (XXX\node_modules\sass-loader\dist\index.js:73:7)
    at Object.done [as callback] (XXX\node_modules\neo-async\async.js:8069:18)
    at options.error (XXX\node_modules\node-sass\lib\index.js:294:32)
 @ ./resources/sass/app.scss

This happens with some colors. deep-purple works for example

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions