-
Notifications
You must be signed in to change notification settings - Fork 49
3.2. JS 支持 Sass
李李家良 edited this page Jul 4, 2017
·
3 revisions
JS 模块支持引入 sass 文件,并通过 Autoprefixer 进行自动补全,返回样式字符串,常用于组件开发。如:
// t.scss
@import "./t1.scss";
@import url(./_t2.scss);
#test{
transition: all .2s ease;
}
// t.js
import css from './t.scss';
console.log(css); // #test{transition: all .2s ease;-webkit-transition: all .2s ease}
( 客户端 v1.0.16+ ) 支持引入 .style.scss
文件,直接作为样式加入到 HTML 中,如:
// t.style.scss
@import "./t1.scss";
@import url(./_t2.scss);
#test{
transition: all .2s ease;
}
// t.js
import './t.style.scss';
// index.html
<style type="text/css">
#test{transition: all .2s ease;-webkit-transition: all .2s ease}
</style>