I'm using react toolbox and in my webpack configuration i have (i post just the significant part of the configuration):
loaders: [
.....
ExtractTextPlugin.extract('style',
'css?sourceMap&modules&importLoaders=1&localIdentName=' +
'[name]__[local]___[hash:base64:5]!postcss!sass') }
]
postcss: [autoprefixer],
sassLoader: {
data: '@import "' + path.resolve(__dirname, 'app/theme/_config.scss') + '";'
}
In app/theme/_config.scss
i have defined:
@import "~react-toolbox/lib/colors";
@import "~react-toolbox/lib/globals";
@import "~react-toolbox/lib/mixins";
$color-primary: $palette-orange-500;
$color-primary-dark: $palette-orange-700;
Right now any strange, my colors are applied correctly.
Now, i want to create a custom Card
component, and i have defined it like this (just for test the theme):
import theme from './style.scss';
const CardStatus = ({ children, ...other}) => (
<Card {...other} theme={theme}>
<CardTitle
title="A title"
subtitle="a subtitle"
theme={theme}
/>
</Card>
);
CardStatus.propTypes = {
children: PropTypes.node
};
export default CardStatus;
In style.scss i have:
.title {
color: yellow;
}
My application compile without errors, but the yellow color are not applied to my CardTitle:
I did tried with:
theme={theme}
theme={theme.title}
But nothing... color not works.
What i have do wrong ?