less

Using a general purpose selector as a mixin in LESS CSS

天涯浪子 提交于 2019-12-03 11:59:05
I know about mixins and parametric mixins. What we are looking for is a way to make any general purpose selectors in CSS / LESS into a mixin. Eg in Twitter BootStrap , we have here .navbar .nav > li { float: left; } If I have to use it in a class say .mynavbar I want to be able to do this INPUT-> .mynavbar { .navbar .nav >li; } OUTPUT-> .mynavbar { float:left; } Now I know this can't be done with the current version of LESS as the compiler flags a parser error. I wanted someone to help me out on changing the source code of less.js a little so that this is workable. I've managed to reach the

LESS mix-in for nth-child?

此生再无相见时 提交于 2019-12-03 11:37:42
问题 I'm trying to make a LESS mixin that will give me this output: .resource:nth-child(8n+1) { clear: left; } I've got this so far: .wrap-every(@n) { &:nth-child(@n + "n+1") { // parse error on this line clear: left; } } .resource { .wrap-every(8); } But it's giving a parse error on the indicated line ParseError: Unrecognised input Is there a way to do this? 回答1: Less >= 1.4 you could do something like this: .wrap-every(@n) { &:nth-child(@{n}n + 1) { clear: left; } } this should have the desired

PSQL 8.3+ client query results display

£可爱£侵袭症+ 提交于 2019-12-03 11:13:11
Rather silly question, but I can't seem to find the answer in the docs or man pages. Starting with 8.3 I think, the psql CLI client will not display the results of a large query inline. It pipes to a 'less-like' result viewer that disappears when you hit q. This makes it very difficult to use data from the first query in subsequent queries or updates. Does anyone know of a switch or way to force psql to display the query results inline, like the old client did? edit: the \x switch does this, but I need the multiple row view. \pset pager off \pset pager on \pset pager always Alternatively,

Intellij IDEA 11: how can I compile .css from .less?

倾然丶 夕夏残阳落幕 提交于 2019-12-03 10:49:44
how can I compile .css from .less in intellij ? sure this should be dead easy, but its got me stumped. anyone know how to do this? IntelliJ IDEA relies on web frameworks and third-party deployment tools to perform this task. There is a feature request to perform such compilation internally , feel free to vote. I wrote a LESS Compiler plugin that automatically compiles LESS files to CSS whenever they change. You can configure multiple LESS directories to watch per project, and the output of each will be copied to one or more output CSS directories that you specify: You can include / exclude

How to use Less with Angular 2?

余生颓废 提交于 2019-12-03 10:48:45
问题 I would like to know how I can add less compiling to my Angular 2 project. Because each component has its own .css file (which now will be a .less file) I am not sure on how I could make the file compile to css... I have also googled the issue without finding any solution to my problem. EDIT To make my question more clear: I would like to have one .less for each component, just as it is as default with the .css files in Angular 2. I just want each .less to be precompiled, and because Angular

How to install and run lessc on top of node.js and Windows?

£可爱£侵袭症+ 提交于 2019-12-03 10:17:43
Hi I am learning LESS and I would like to install lessc on my Windows 7. Following this tutorial http://verekia.com/less-css/dont-read-less-css-tutorial-highly-addictive The first step is I dowloaded and installed node.js (node-v0.10.5-x64.msi). Then in a console, I ran npm install less -g I got the following: npm http GET https://registry.npmjs.org/less npm http 304 https://registry.npmjs.org/less npm http GET https://registry.npmjs.org/ycssmin npm http 304 https://registry.npmjs.org/ycssmin C:\Users\Me\AppData\Roaming\npm\lessc -> C:\Users\Me\AppData\Roaming\npm\node_modules\less\bin\lessc

variable @fontAwesomeEotPath_iefix is undefined

旧时模样 提交于 2019-12-03 09:29:59
I'm working on my first project with bootstrap and I get this error whenever I try and view my project. I've looked around and haven't been able to find someone with same problem. Any help would be great! Thanks in advance. Less::ParseError in Search#index Showing /Users/Basil/Dropbox/College/CS 50/playedby.me/app/views/layouts/application.html.erb where line #4 raised: variable @fontAwesomeEotPath_iefix is undefined (in /Users/Basil/Dropbox/College/CS 50/playedby.me/app/assets/stylesheets/bootstrap_and_overrides.css.less) Extracted source (around line #4): 1: <!DOCTYPE html> 2: <html> 3:

Lighten color from parent in Less

拈花ヽ惹草 提交于 2019-12-03 09:06:52
I am starting out with Less and one of the reasons I wanted to is because of the ligthen() function. So my first attempt was to do something with that. This is my HTML <div class="box blue"> <div class="boxbar">Foo</div> blue </div> I finally got it working, but I doubt it's supposed be like this: @blue: #468ACE; @green: #41A53D; @red: #9C2525; @purple: #8938BF; div { padding: 10px; } .blue { background-color: @blue; .boxbar { background-color: lighten(@blue, 10%); } } .green { background-color: @green; .boxbar { background-color: lighten(@green, 10%); } } .red { background-color: @red;

Compile less files and minify js files in node.js project on AWS Elastic Beanstalk

匿名 (未验证) 提交于 2019-12-03 09:05:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using the Eb Command Line Interface to deploy a node.js project to AWS Elastic Beanstalk. I am using git for version control. So the command I run to deploy is simply 'git aws.push'. Locally, I am using grunt to compile css files from less files and also minify and cmobine js files. I don't want to include the *.min.css files or *.min.js files in my git repository but would rather have them recompiled on AWS after deployment. Is there a way to do this? Maybe with a .ebextensions hook or something? 回答1: I am not familiar with grunt, but

CGAL: convex hull of points with info

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a vector of 2D points (N elements) in the plane. I want to make the convex hull of these points. After that, I want to retrieve the vector index of each vertex in the convex hull, how can I do this? I know that, there is such possibility for triangulation by making use of vector<pair<Point_2, unsigned> > , but when I use paired point in making convex hull, it produces a bunch of errors. This is the related piece of code that I use: #include <iostream> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL