使用
程序员文章站
2022-03-03 16:15:00
...
less中
Node中
npm install -g less
lessc styles.less
lessc styles.less styles.css
lessc styles.less > styles.css
浏览器中
<link rel="stylesheet/less" type="text/css" href="styles.less" />
<script src="[//cdnjs.cloudflare.com/ajax/libs/less.js/3.8.1/less.min.js](https://cdnjs.cloudflare.com/ajax/libs/less.js/3.8.1/less.min.js)" ></script>
sass中
gem install sass
sass input.scss output.css
sass --watch input.scss:output.css//自动更新
sass --watch app/sass:public/stylesheets//监控整个目录
sass --style compressed test.sass test.css//生产环境中
# 将 Sass 转换为 SCSS
$ sass-convert style.sass style.scss
# 将 SCSS 转换为 Sass
$ sass-convert style.scss style.sass
stylus
npm install stylus
stylus example.styl
npm install stylus stylus-loader --save-dev
<style scoped lang="stylus" rel="stylesheet/stylus"></style>
<style lang="stylus" rel="stylesheet/stylus"></style>
<style>
@import "content.styl"
</style>