less.js

How to apply less functions to gradient colors?

≡放荡痞女 提交于 2019-12-02 04:38:27
I am new in less. I want to apply less functions to the gradient colors. I have tried best of my knowledge but I couldn't get the output. Can any one please suggest me the correct way to get the less function derived colors. I tried the below codes. @input: #fff , #aaa 25%, #ccc 50%, #000 100%; @light: 10%; @dark: 20%; div{ .custom-grad(@input, @light, @dark); } .for(@array) when (default()) {.for-impl_(length(@array))} .for-impl_(@i) when (@i > 1) {.for-impl_((@i - 1))} .for-impl_(@i) when (@i > 0) {.-each(extract(@array, @i), @i)} .custom-grad(@input, @light, @dark) { .for(@input); .-each(

My LESS math operations aren't working in my media query definitions

天涯浪子 提交于 2019-12-02 01:37:32
I'm trying to make the breakpoints of a layout a less-variable so I could easily check out multiple ideas but this: @breakpoint: 500px; @media all and (min-width: @breakpoint){ #someid{ height: 4321px; } } @media all and (min-width: @breakpoint + 1){ #someid{ height: 1234px; } } #someid{ height: @breakpoint + 1; } compiles to this: @media all and (min-width: 500px) { #someid { height: 4321px; } } @media all and (min-width: 500px + 1) { /*THE PROBLEM*/ #someid { height: 1234px; } } #someid { height: 501px; } Calculations on variables wont happen in a media query, or at least not in the way that

Less安装及使用,cnpm安装

左心房为你撑大大i 提交于 2019-11-30 17:59:46
1.打开命令行查看node.js是否安装C:\Users\lenovo>node -v -> v8.9.0 2.安装less C:\Users\lenovo>npm install -g less 3.查看less C:\Users\lenovo>lessc -v lessc 3.10.3 (Less Compiler) [JavaScript] 4.编译less cd 进入less所在目录,使用lessc xx.less xx.css编译less文件成css文件 5.如果想在项目中直接使用less样式,需要在引入less文件之后,引入less.js文件 6.cnpm安装 C:\Users\lenovo>npm i cnpm -g 7.cnpm查看 cnpm -v 8.nrm安装 npm i nrm -g, 使用nrm ls列出所有镜像地址,nrm use npm, 切换地址。 nrm 只是单纯的提供了几个常用的 下载包的 URL地址,并能够让我们在 这几个 地址之间,很方便的进行切换,但是,我们每次装包的时候,使用的 装包工具,都是 npm 来源: https://my.oschina.net/u/4161514/blog/3113814

Gulp.js - Use path from gulp.src() in gulp.dest()

百般思念 提交于 2019-11-28 15:52:42
Trying to create a gulp task that will pipe a bunch of files from different folders through LESS and then output them to a folder based on the original source. Consider this folder structure: Project +-- /Module_A | +- /less | | +- a.less | +- a.css | +-- /Module_B +- /less | +- b.less +- b.css Here's my gulpfile: var gulp = require('gulp'); var gutil = require('gulp-util'); var less = require('gulp-less'); gulp.task('compileLess', function () { gulp.src('./*/less/*.less') .pipe(less()) .pipe(gulp.dest( ??? )); }); gulp.task('default', ['compileLess']); I know gulp.dest() expects a path to be

Gulp.js - Use path from gulp.src() in gulp.dest()

≡放荡痞女 提交于 2019-11-27 19:49:25
问题 Trying to create a gulp task that will pipe a bunch of files from different folders through LESS and then output them to a folder based on the original source. Consider this folder structure: Project +-- /Module_A | +- /less | | +- a.less | +- a.css | +-- /Module_B +- /less | +- b.less +- b.css Here's my gulpfile: var gulp = require('gulp'); var gutil = require('gulp-util'); var less = require('gulp-less'); gulp.task('compileLess', function () { gulp.src('./*/less/*.less') .pipe(less()) .pipe

Less js: Mixin property as an argument of another mixin?

怎甘沉沦 提交于 2019-11-26 23:26:01
问题 How could I create a mixin that uses as an argument a nested mixin property? I explain myself with the next example. I have a 'transition-property' mixin: .transition-property (@props){ -webkit-transition-property: @props; -moz-transition-property: @props; -o-transition-property: @props; transition-property: @props; } From this mixin I want to use a 'transform' mixin property, so I tried to call this like: .transition-property(~"opacity, .transform"); The '.transform' mixin should return one