less

Lesscss command line compiler Lessc

点点圈 提交于 2019-12-10 13:00:53
问题 Hi Im trying to get the LessCss command line compiler installed on a Mac. I've tried brew install less Error: No available formula for less brew install lessc Error: No available formula for lessc sudo npm install -g less ..Installs happily.. sudo npm install -g lessc npm http GET https://registry.npmjs.org/lessc npm http 404 https://registry.npmjs.org/lessc npm ERR! 404 'lessc' is not in the npm registry. npm install less --global ..Installs happily.. npm install lessc --global npm http GET

How to combine several Font Awesome classes into one selector using LESS?

天大地大妈咪最大 提交于 2019-12-10 12:23:16
问题 I'm trying to nest a bunch of font awesome styles into a single css class I can use whenever I'd like. However, I'm getting an error with "Undeclared Mixin". My .less file looks something like this: @import (reference) "../Content/bootstrap/font-awesome/font-awesome.less"; .step-current { .fa; .fa-play; .text-success; } In this case all I'd like to do is apply the styles .fa, .fa-play, and .text-success whenever I use the class step-current on an element. However, I'm getting an error when I

less 的使用

假装没事ソ 提交于 2019-12-10 12:13:32
less 的使用 一、 Less环境安装 1.1 安装 安装完成nodejs之后 检测是否安装完成 node –v 查看版本 然后检测 npm是否自带 npm –v 查看版本 若没有安装,则 运行 npm install –g less (部分电脑要 sudo 管理权限)即可安装。 Lessc –v 查看版本 是否安装成功 Lessc less.less less.css 编译less文件成css 1.2 HbuilderX中的配置 直接下载less插件,新建less类型文本文件之后,按下图找到配置文件后,修改onDidSaveExecution为true,设置快捷键为:Ctrl+S。即可实现快速自动编译,生成一个对应的.css文件。如果没有生效,重启HbuilderX。 "extensions": "less", "key": "ctrl+s", "showInParentMenu": false, "onDidSaveExecution": true 二、less用法 使用目的:简化 CSS 的编写,并且降低了 CSS 的维护成本,LESS 可以让我们用更少的代码做更多的事情。 本质上,LESS 包含一套自定义的语法及一个解析器,用户根据这些语法定义自己的样式规则,这些规则最终会通过解析器,编译生成对应的 CSS 文件。LESS 并没有裁剪 CSS 原有的特性,更不是用来取代

Generating selector lists in LESS

让人想犯罪 __ 提交于 2019-12-10 10:57:54
问题 Live demo here: http://codepen.io/KenPowers/pen/Ddfqh Consider the following LESS code: // Hide all list items by default and make internal labels have pointer cursors li { display: none; label { cursor: pointer; } } // This function generates selectors and corresponding css .gen (@tag) { @sel: ~"#@{tag}:checked"; @{sel} { & ~ ul > li[data-index~=@{tag}] { display: list-item; } & ~ ul > li > label[for=@{tag}] { color: red; } } } // Generate required selectors and css .gen("foo"); .gen("bar");

Git flag non-modified files as modified when generated by LESS or if line separator has changed

China☆狼群 提交于 2019-12-10 10:52:52
问题 I have an issue using git. It basically flag files that haven't modified in two different cases: When the file has been regenerated by my LESS file watcher (for unknown reason), the content hasn't changed, it is exactly the same as before. When the lne separator has changed, because LESS use always LF for generated .css, whatever the line separator of the source file (less) is. I've added a screenshot. I don't understand why these files are flag as modified, it messes up my git because it

How do you call a less.js function

 ̄綄美尐妖づ 提交于 2019-12-10 10:09:05
问题 I'm not even really sure how to ask this. The LESS CSS Framework contains several functions to manipulate color, I'd like to know how to call these functions myself to modify a color. The problem is that these functions are located inside another function and defined as such: (function (tree) { tree.functions = { darken: function(color, amount){ ...stuff... } } } I know enough to assume that darken is a method of tree.functions , but for the life of me don't know how to call it because it is

Using math functions to get integer values

微笑、不失礼 提交于 2019-12-10 10:08:48
问题 I have some LessCSS that essentially looks like this: .foo { @height: 20px; @iconHeight: 13px; background-position: 0 (@height - @iconHeight) / 2; } However, this obviously turns out as background-position: 0 3.5px , and I'd prefer for it to be an integer (the value of Math.ceil ), however this doesn't work: background-position: 0 Math.ceil((@height - @iconHeight) / 2) Nor does using the javascript evaluation operator: background-position: 0 `Math.ceil((@height - @iconHeight) / 2)` ...since

Modify Bootstrap LESS files to use an ID selector

£可爱£侵袭症+ 提交于 2019-12-10 10:04:02
问题 Briefly, what I'm trying to do is apply a custom ID selector on top of Bootstrap.CSS so that I don't break other CSS on a website. So this : .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col

How to get the Rhino edition of Less v.2.0.0 using bower as a package manager

柔情痞子 提交于 2019-12-10 08:42:52
问题 I'm using the Rhino edition of less.js, extracted to my devlopment environment using bower. Under 1.7.5 everything worked fine, bower would get all the different editions, both Node and Rhino editions would be stored in my environment. With the recent update to 2.0.0 it would seem that only the Node versions are included. Is there some way to get bower to extract the Rhino edition? I can of-course download it manually, but then I would have to manually maintain that reference. Keeping track

Symfony 2 how to import LESS files from another bundle

六眼飞鱼酱① 提交于 2019-12-10 04:35:52
问题 LESS has the power to @import other LESS files. This question is intended to find a solution to import LESS files within LESS files from another Bundle in a Symfony project I'm working on a Symfony2 project, using LESS and Assetic to watch changes. My LESS files are able to import other LESS files but only if they are in the same bundle. If I try to import from another bundle Assetic watch stops with error "variable undefined" because the import fails. I've tried all sorts of paths in the