参考链接
https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
使用方法
// styles/animation.scss
$animation-length: 250;
$animation-length-ms: $animation-length + 0ms;
:export {
animationMillis: $animation-length-ms;
}
// test.js
import styles from '../styles/animation.scss'
const millis = parseInt(styles.animationMillis)