[Colors and theming] - Exception: "$color of red($color) must be a color" for certain colors
See original GitHub issueWhen 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
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Bootstrap SCSS: $color: theme-color("primary") is not a color
I'm trying to override bootstrap4 styles. I have no experience with Sass, but this looks like an error in the bootstrap SCSS file....
Read more >Theme Color | Visual Studio Code Extension API
Theme Color reference that lists all themable colors in Visual Studio Code. ... Some colors should not be opaque in order to not...
Read more >Building a Material Theme on Android: Color
How to create a color theme on Android using the MDC library. ... Some, such as colorSurface , use neutral colors so relying...
Read more >Color - Foundations - Human Interface Guidelines - Design
Consider how the colors you use might be perceived in other countries and cultures. For example, red communicates danger in some cultures, but...
Read more >Color | Android Developers
Color ints are the most common representation of colors on Android and have been ... The red, green and blue components must be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I believe 353de23 should have fixed this issue and is released in v2.1.1. The simple test script I wrote to compile all
$rmd-*
colors worked without throwing errors with this fix, but just let me know if this error still occurs and I’ll reopen this issue.Simple test script (mostly so I can reference this again)
I can try to help out if you provide the following information:
react-md
andsass
$rmd-*
overrides you are using