-
-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Colors and theming] - Exception: "$color of red($color) must be a color" for certain colors #884
Comments
This error occurs when you use a css color name string provided by the css color value spec and not one of the If it's one of the color value strings, I think this is an issue with sass itself but I could use that lookup table in the link above to get a hex value. |
I'm using the |
Ooh, interesting. Thanks! That'll help me debug this a bit more and hopefully have a fix out this week.
|
I believe 353de23 should have fixed this issue and is released in v2.1.1. The simple test script I wrote to compile all Simple test script (mostly so I can reference this again)const { renderSync } = require('node-sass');
const scssVariables = require('@react-md/theme/dist/scssVariables').default;
const colors = Object.keys(scssVariables).filter(
(name) => !name.startsWith('rmd-theme')
);
const errors = [];
colors.forEach((color) => {
const data = `@import '@react-md/theme/dist/scss/color-palette';
$rmd-theme-primary: $${color};
@import 'react-md/dist/scss/react-md';
@include react-md-utils;
`;
try {
// console.log(`Trying to compile '$${color}'...`);
// console.log(data);
// console.log('');
renderSync({
data,
includePaths: ['node_modules'],
});
// console.log('Compiled successfully!');
} catch (error) {
errors.push({ color, error });
}
});
console.log(JSON.stringify(errors, null, 2)); |
Even I am facing the same issue, can someone help me figure out the solution? |
I can try to help out if you provide the following information:
|
When I'm trying to adjust the color theme sometimes I get an exception on SCSS compile-time:
This happens with some colors. deep-purple works for example
The text was updated successfully, but these errors were encountered: