less

How to compile lesscss using node.js

﹥>﹥吖頭↗ 提交于 2019-12-07 09:13:31
问题 Hi, I have finished to code my website using lesscss client side and now want to compile less so I have donwloaded node.js . My website is running on localhost and I want first to know: where I have to install node.js what I have to do next ( commands lines tools, commands lines etc. ). If someone can help me because I'm a newbie in this field. Thanks. 回答1: You can install the LESS compiler directly from npm . Install node.js . Go to this page and download the installer for your platform. If

Angular CLI 'ng serve' to ignore less and use available css

此生再无相见时 提交于 2019-12-07 07:38:25
I am using Angular CLI for Angular2 project. And I am using less for my styling. To compile less file with Angular CLI, I have to import less file with its absolute path. Which breaks editor's intellisense. So instead of using LESSPlugin comes with AngularCLI, I want to use IDE's less watcher and compiler (available in vs code as well as webstorme) to compile less to css. But there are less files still exists in source, 'ng serve' try to compile less and that breaks the build. Is there any way to configure angular cli to ignore less file and use available css in source folder? I manage to do

lessc: command not found

天大地大妈咪最大 提交于 2019-12-07 06:59:29
问题 I'm on OS X.8 and a newbie at Node & LESS. I thought I installed lessc earlier and when I go to /usr/local/bin I see lessc but for the life of me, I can't run it. Anytime I do run it, I see -bash: lessc: command not found So I've tried the tip here which has the following: ln -s ~/.npm/less/1.3.3/package/bin/lessc my/local/dir My local dir happens to be on a second drive on my laptop, here's the path: /Volumes/Mac17/Users/denis2/Sites/staging/assets/less With all that said, I try and run:

What values I should set in twitter bootstrap for a fixed 960px layout?

你说的曾经没有我的故事 提交于 2019-12-07 06:29:56
问题 I'm using twitter bootstrap with less cloned from github. I want to set grid width variables because I need a 960px fixed layout. Default values for 940px width are: @gridColumns: 12; @gridColumnWidth: 60px; @gridGutterWidth: 20px; What values I should set for a fixed 960px layout? I tried with this, but result was 950px: @gridColumns: 12; @gridColumnWidth: 70px; @gridGutterWidth: 10px; 回答1: Solve the equation You need to find a solution(s) for the equasion. One of them is: @gridColumns: 12;

Passing less variables from webpack

馋奶兔 提交于 2019-12-07 06:11:53
问题 I'm trying to pass less variables within a webpack configuration to the less loader, naturally. For some reason the variable is not being passed ok. I can't figure the correct syntax. The variable has a dynamic content that is determined at the build time, in the webpack config file. This is the relevant line (I've tried many variations of it): loader: 'style!css?-minimize!less?-minimize&{modifyVars:{"resources-path-prefix":"' + pathPrefix + '"}}' In the above example some pathPrefix is being

Rounded corner tables with LESS

邮差的信 提交于 2019-12-07 06:04:19
问题 After some digging around on SO I found this as the best response for my need of having rounded corners for tables. Which lead me to the following CSS snippet: .greytable tr:first-child th:first-child { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; } .greytable tr:first-child th:last-child { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; } .greytable tr:last-child td:first-child { -moz

@viewport, @media and LESS

最后都变了- 提交于 2019-12-07 05:32:00
问题 I've recently converted some CSS to LESS for use with a .NET application (I am using dotless for .NET, http://www.dotlesscss.org/ to compile the LESS at runtime). The compiler is falling down on these two blocks of code: @viewport { width: device-width; } /* Add a min-width for IE 8 and lower */ @media \0screen\,screen\9 { body { min-width: 960px; } } Just for your reference, the media query above is a hacky way of targeting IE How can I "LESS-ify" these blocks of code? 回答1: In Less >= 1.4.0

less.js - get variable values inside parsers' callback

三世轮回 提交于 2019-12-07 05:06:36
问题 I am using less.js (1.3.0) to parse less to css on the client side. Inside the parsers' callback I want to get the value for each variable. i tried the following without success. var data = "@colour: red; #example { background-color: @colour; }", parser = new less.Parser({}); parser.parse(data, function (error, root) { console.log( root.toCSS() ); var varsDef = root.variables(); for (k in varsDef) { console.log(varsDef[k]); // how to get the value for the var? //not working console.log

Bundling less and css files together

心不动则不痛 提交于 2019-12-07 04:53:24
问题 I feel like bundling should be used to group a bunch of files which you use together into one single delivery to the browser. This would mean for example for my root style I would like to do something like the following: var bundle = new StyleBundle("~/Content/style").Include( "~/Content/mystyle.less", "~/Content/bootstrap.css", "~/Content/bootstrap-responsive.css"); bundle.Transforms.Add(new LessTransform()); bundle.Transforms.Add(new CssMinify()); bundles.Add(bundle); But this doesn't seem

express.js less compiler: can not get work

拜拜、爱过 提交于 2019-12-07 04:51:11
问题 app.js: app.use(express.compiler({ src: __dirname + '/public', enable: ['less']})); app.use(express.static(__dirname + '/public')); In my jade view: link(rel="stylesheet", type="text/css", href='/app/stylesheets/app.less) I've got less file in: public/app/stylesheets/app.less When I request the page I've got in html head: <link href="/app/stylesheets/app.less" type="text/css" rel="stylesheet"> And noting in server console. 1) So Why does express even doesn't try to compile app.less? Should it