We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.module { .action { a, a:hover { //styles } } }
.mixin(@heitht: 10px) { // 这里看起来更像是函数,可以传入参数(还可以指定默认值,强大!跟es6的默认参数有点像) height: @height } .classA { .mixin(); } .calssB { .mixin(15px;) // 这里可以将参数重定义为15px }
.block { margin: 10px 5px; padding: 2px; } p { .block;/*继承.block选择器下所有样式*/ border: 1px solid #eee; }
.mixin(@height: 10px) when (@height >= 10) { ... }
它可以在浏览器和服务端两种环境运行,服务端通过npm下载然后require进来即可,浏览器上直接引入less.js文件即可。下面说一下配合gulp来编译less,直接上代码
``` gulp.task('lessToCss', function() { gulp.src('url.less') .pipe(sourcemaps.init()) // 生成sourcemap 方便查找 .pipe(less()) .pipe(sourcemaps.write('./maps')) .pipe(gulp.dest('static/css')); gulp.watch('less.scss', ['less']); }); ```
关于sourcemap
The text was updated successfully, but these errors were encountered:
No branches or pull requests
优点
缺点
使用
它可以在浏览器和服务端两种环境运行,服务端通过npm下载然后require进来即可,浏览器上直接引入less.js文件即可。下面说一下配合gulp来编译less,直接上代码
关于sourcemap
The text was updated successfully, but these errors were encountered: