Closed jt3k closed 4 years ago
@jt3k
How about using the @import CSS
annotation?
If the pug file name is Sample.pug
, the code below will automatically import Sample.scss
.
(Definitions for css or scss loaders should be added to webpack.)
// @import .scss => styles
div(className='{styles.lolo}')
div(className='{styles.lala}')
h1 {message}
.lolo {
background: red;
.lala {
color: blue;
}
}
import React from 'react';
import styles from './Sample.scss';
export default function (props = {}) {
const { greetings } = props;
return (
<div className={styles.lolo}>
<div className={styles.lala}>
<h1>{message}</h1>
</div>
</div>
);
}
👍
I have two questions.