less

Hex Colors - How to Calculate from 1 Color to Another

本小妞迷上赌 提交于 2019-12-12 02:54:46
问题 I work on .LESS and I am looking for a method how calculate from a hex color to another. For example: I have #000000, then I do some calculations (lighten, or darken, or mix...) somehow finally it will become #657177. Let's say: @header-background: #000000; @tags: lighten(@header-background, 30%); I have tried many percentage numbers, but I couldn't get exactly from #000000 to #657177. Please give a hand. Thanks! 回答1: Try using http://www.w3schools.com/colors/colors_picker.asp since you know

Less mixin generate error on IE8

て烟熏妆下的殇ゞ 提交于 2019-12-12 02:53:34
问题 I receive this error on IE8 when I'm using this mixin: SyntaxError: Object doesn't support property or method 'map' >>less<< body{.gradient; } >>mixin<< .gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) { background: @color; background: -webkit-gradient(linear, left bottom, left top, color-stop(0, @start), color-stop(1, @stop)); background: -ms-linear-gradient(bottom, @start, @stop); background: -moz-linear-gradient(center bottom, @start 0%, @stop 100%); background: -o-linear-gradient(

How to apply condition on grandparent from within the child class in Less

我怕爱的太早我们不能终老 提交于 2019-12-12 02:52:07
问题 <div class="grandParent active"> /*active class added dynamically*/ <div class="parent1"> <div class="childOfParent1"> Some Text </div> </div> <div class="parent2"> <div class="childOfParent2"> Some Text </div> </div> </div> Using Less how can i apply the child text color depending on grandParent class .grandParent { .parent1 { .childOfParent1 { color : red; .grandParent:not(active) .parent1 .childOfParent1 { color : green; } } } } The above is possible using the below code but i do not want

LESS '+=' a string lessjs 1.6.x

天大地大妈咪最大 提交于 2019-12-12 02:37:51
问题 is it possible to += (plus-equal) a string in LESS (less-css)? I am trying to create a loop to extend a string. In particular I am trying to create a mixin (no inline JS) that can add vendor prefixes to transform in transition-propery basic for loop // for-loop // works with two integers or a list .for(@i;@n) when (@i <= @n) {.-each(@i);} .for(@n) when not (isnumber(@n)) {.for(1;length(@n));} .for(@i;@n) when not (@i = @n) {.for(@i + 1;@n);} prop loop (duplicated for loop to resolve variable

Is there a way I can overwrite LESS variable with LESS compiler in PHP?

亡梦爱人 提交于 2019-12-12 02:36:52
问题 Currently I am using the lessphp as my LESS compiler. I know it provides a way to set the LESS variables, but is there a way to overwrite the variables set in the file? For example, I have the following LESS file: @theme-color: #000055; h1 { color: @theme-color; } h2 { color: @theme-color * 1.3; } h3 { color: @theme-color * 1.5; } To compile it in PHP, require"path/to/leafo/lessphp/lessc.inc.php"; $less = new lessc; $less->setVariables(array( "theme-color" => "#000055" )); $less->compileFile(

Can I use less4j to compile less into css in ANT?

柔情痞子 提交于 2019-12-12 02:05:27
问题 I am wondering if some one could give me a demo. When I use less4j, in tag, what should I put in ? I searched online for a long time, but it seems that there are no information about using less4j in ANT at all. But since less4j could be implemented in command line, so it must be implementable in ANT. Please help me with this, thanks! 回答1: <?xml version="1.0" encoding="UTF-8"?> <project name="compile" default="css.concatenate" basedir="."> <property name="charset" value="utf-8"/> <macrodef

grunt-contrib-less: compilation on watch task removes sourcemap link

醉酒当歌 提交于 2019-12-12 01:39:53
问题 Here's my less task config: less: { development: { options: { compress: false, sourceMap: true, yuicompress: true, sourceMapFilename: 'export/style/app.css.map', sourceMapURL: '/style/app.css.map' }, files: { "export/style/app.css": "less/app.less" } } }, If I just type grunt less , in my compiled file i get the /*# sourceMappingURL=/style/app.css.map */ comment correctly. Instead, when i run grunt and my watch task kicks in, the /*# sourceMappingURL=/style/app.css.map */ comment is removed

Passing a variable list through .for loop using Less 2.6.1 is unable to compile

放肆的年华 提交于 2019-12-12 01:27:18
问题 I have been using a Less mixin which makes looping in Less, less verbose and is really handy: https://github.com/seven-phases-max/less.curious/ I upgraded from Less 2.6.0 to Less 2.6.1 and now the Less will not compile. Here's the Less code: // ............................................................ // .for .for(@i, @n) {.-each(@i)} .for(@n) when (isnumber(@n)) {.for(1, @n)} .for(@i, @n) when not (@i = @n) { .for((@i + (@n - @i) / abs(@n - @i)), @n); } // ................................

'Make' command not found (associated with Less)

笑着哭i 提交于 2019-12-12 00:36:41
问题 I Installed Nodejs, then installed the LESS command line compiler. $ npm install -g less uglify-js From here: http://twitter.github.com/bootstrap/less.html#compiling Now getting the following error when i run the Make Command. sh.exe": make: command not found Any clues why? Thanks much! 回答1: You don't have a GNU make utility available. You can get make in many ways: get Make for Windows http://gnuwin32.sourceforge.net/packages/make.htm get cygwin on Windows and install the make package http:/

Smart margin mixin for LESS

白昼怎懂夜的黑 提交于 2019-12-12 00:35:25
问题 I've created a .smartMargin() mixin for LESS CSS to be used in responsive design LESS. I'm sharing it here for the benefit of others and also because I'm curious if there's any way to make it more efficient. Idea The mixin is designed to be called from within another mixin that represents a responsive design breakpoint. The idea is that you may want to override top, left, bottom, right margins individually by overriding one or more margins in each successive breakpoint. In main mixin I just