TeodorKolev TeodorKolev - 2 months ago 24
Sass (Sass) Question

Override css class in React

My target is to override css class in react. Already defined class has properties from css framework. I want to save that properties and to add some own new.

Html:

import styles from '../../css/style.scss';

export default class Class extends React.Component {

constructor() {
super();
}

render() {
return (
<div className="item">
<div className="image">
<img src="" />
</div>
<div className="content">
<span className="header"><span>
</div>
</div>
);
}
};


Sass:

.item {
.content {
.header {
text-transform: capitalize;
}
}
}

Answer

Use:

require("!style!css!sass!../../css/style.scss");

instead of:

import styles from '../../css/style.scss';
Comments