less

Auto-generate LESS styles for sprite icons

ぃ、小莉子 提交于 2019-12-21 23:55:34
问题 I have icon sprites image with each icon in a 20 by 20 pixel area. Each icon has several variants (black, colour, white small etc.). And have a significant amount of them. Instead of writing styles for each individual icon I'd rather just provide their names in my LESS file and let the processor generate styles for them. This is what I came up with but it doesn't seem to work. @icons: upvote,downvote,comment,new,notify,search,popup,eye,cross; @array: ~`(function(i){ return (i + "").replace(/[

Using LESS mixin to set variable multiple times but getting wrong results

99封情书 提交于 2019-12-21 23:25:13
问题 At the front, I started with less today... So any advice how to do that better is welcome! I have following .less file: .test(@target;@context) { @em: (@target / @context) * 1em; } .custom-field { position: relative; .test(30;16); padding-bottom: @em; .test(30;16); margin-bottom: @em; .test(320;16); max-width: @em; } I expect that padding-bottom and margin-bottom getting the value 1.875 and max-width: 20. But thats the output: .custom-field { position: relative; padding-bottom: 1.875em;

LESS strictImports

那年仲夏 提交于 2019-12-21 21:39:47
问题 I have a build that compiles several less files (all are actually imported into one master.less file). One of the options for the build is strictImports which suggests that it forces the evaluation of imports. Does anyone know if this have to do with operations in imported files, or am I completely missing the point? 回答1: The strictImports controls whether the compiler will allow an @import inside of either @media blocks or (a later addition) other selector blocks. See some of the comments

Netbeans 7.4 - exclude LESS partial source files from compiling to css

爱⌒轻易说出口 提交于 2019-12-21 20:43:05
问题 This is mostly a nuisance problem (creating clutter in my css directory). I want to know if, in Netbeans 7.4 (or 8.0 beta?), there is any way to tag a LESS file to no be compiled on run/save. I have a library.less and vars.less file that are .mixins and @variables that get used site-wide in several other less files as includes but don't need to be compiled themselves as they produce effectively empty CSS. I'd like Netbeans OR lessc.cmd to ignore them if possible. Is it something that can be

Netbeans 7.4 - exclude LESS partial source files from compiling to css

被刻印的时光 ゝ 提交于 2019-12-21 20:42:34
问题 This is mostly a nuisance problem (creating clutter in my css directory). I want to know if, in Netbeans 7.4 (or 8.0 beta?), there is any way to tag a LESS file to no be compiled on run/save. I have a library.less and vars.less file that are .mixins and @variables that get used site-wide in several other less files as includes but don't need to be compiled themselves as they produce effectively empty CSS. I'd like Netbeans OR lessc.cmd to ignore them if possible. Is it something that can be

LESS - Nesting generates bad CSS code? [closed]

三世轮回 提交于 2019-12-21 20:35:18
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . In the following article I read that one should try reduce the number of selecetors. Article: use less selectors I'm wondering if writing LESS and I'm using a lot of nesting to group parent and child elements, will that generate bad CSS code in the end? LESS .wrap{ width: 100

NodeJs安装less(npm方式)

浪子不回头ぞ 提交于 2019-12-21 20:16:44
上一次讲了如何在浏览器端解析less文件,这次是在cmd中使用npm中的less模块来解析 详解如下 首下我们去下载一个https://nodejs.org/en/ , 一路next之后,因为文件不大,就直接在C盘了 当然我个人是不推荐在C盘的,你喜欢在哪个盘就哪个盘 进入cmd 好,我们已经看到了node和npm的版本号了 说明我们已经成功安装了 如果没有看到,说明你需要在 管理员权限 下执行cmd 然后你需要创建两个文件夹 在CMD中输入 npm config set prefix "C: \Program Files \nodejs \node_global" npm config set cache "C: \Program Files \nodejs \node_cache" 这样就应该正确了 好下面,进入less中文网,我们看下怎么安装 在安装这一项里面,我们可以看到,$符号就不用输了 在cmd里面输入 npm install -g less,经过漫长的等待以后,恩,好了@_@ 如图所示,已经安装了 下面要找到我们的lessc文件在哪个文件夹里面了 来看C盘的nodeJS下的node_global文件夹里面找到了 那我们就从CMD里面进入这个文件夹 好,现在已经进入这个文件夹了 下面就是一个转化语句了 lessc styles.less styles.css

Less Windows Node.js Hanging

戏子无情 提交于 2019-12-21 17:17:11
问题 I have been trying to setup Symfony2 on Windows so that I can use assetic with less. I have installed node.js for Windows (0.6.8). Then I have run npm install less --global and found less in C:\Users\Matt\AppData\Roaming\npm\node_modules As far as my Symfony setup, I have the master branch of Assetic (due to a bug I read about in 1.0.2), but the standard v1.0.1 of AsseticBundle After some work, I was able to get an example less file to render via: http://localhost/app_dev.php/css/compiled

How to change parent style by child :hover action in LESS

梦想与她 提交于 2019-12-21 14:23:12
问题 I have this LESS setup: .wrapper { .parent { height: 100px; .children { //some style; &:hover { .parent & { height: 150px; } } } } } I need to change some height for parent element by hover on some child inside of it. This code is not working, so is there any possible to do this? Much thx for help. 回答1: Adding the :hover to the .parent instead of the .children div will achieve the result, http://codepen.io/duncanbeattie/pen/xvDdu .wrapper { .parent { pointer-events:none; height: 100px;

LESS/SASS CSS opposite from minification/optimizations?

你。 提交于 2019-12-21 14:12:13
问题 I wonder can I say that LESS/SASS CSS "pre-processors( I think they are called? )" is the opposite from optimizations like minification? I wonder if there will be any noticeable performance impact? or do you think easy of development is more important? I ask this because what LESS CSS generates is something like body #div1 #div2 p body #div1 #div2 p a:link, body #div1 #div2 p a:visited ... and I think it can really bloat up my CSS quite a bit. as you can see, such specificity is not required