less

What is the equivalent of command “Compass watch” for LESS CSS pre-processor?

放肆的年华 提交于 2019-12-05 20:32:37
I was using SASS as CSS pre-processor for Drupal theme. Where in the command line if I use $ compass watch . It keep on watching the change in .scss file and apply to .css file. Just I am trying Bootstrap theme and there I am using LESS CSS pre-processor, Where I have to use $ lessc less/style.less css/style.css every time to apply change. What is the equivalent of $ compass watch for LESS. You need to install less-watch-compiler: npm install -g less-watch-compiler Make sure you installed less globally: npm install -g less In Terminal, navigate to your working directory path and run the

Is it faster to precompile less?

我的未来我决定 提交于 2019-12-05 20:23:29
So I am wondering whether it is better for me as far as page speed, to precompile my less style sheets instead of using less.js. After testing this via google page speed, I noticed I actually went down a couple points after precompiling. As far as i know it should be less demanding on the user. But I guess I am wrong? Is there something else I should take into account? Minifying the css is also an option, but I don't think that will make a considerable difference. Thanks. I think you should change the title of your question in something like "does precompiling Less generates a better page

less 文件 媒体查询 循环

旧巷老猫 提交于 2019-12-05 20:18:43
@charset "utf-8"; @psdwidth: 1024; // 设计稿 尺寸 @basesize: 100; // 分为多少份 @bt: 100rem; // 换算值 @fit: 320px, 360px, 375px, 384px, 400px, 414px, 424px, 450px, 480px, 540px, 640px, 720px, 750px, 1024px, 1920px; .rtrt(@index) when (@index<=length(@fit)) { @media (min-width: extract(@fit,@index)) { html { font-size: extract(@fit,@index)/@psdwidth*@basesize; } } .rtrt(@index+1); } .rtrt(1); html, body { width: 100%; height: 100%; } 来源: https://www.cnblogs.com/xiaozhu-zhu/p/11945034.html

How to recompiles .css files starting from bootswatch .less files?

瘦欲@ 提交于 2019-12-05 20:08:01
I succesfully installed node and less I downloaded from bootswatch the following two files from them 'Flatly': variable.less bootswatch.less Now I'd like simply create the final boostrap.css without do any modification, just to try if all is indetical to precooked bootstrap.css files from the same theme. I tried lessc variables.less > bootstrap.css But I got empty boostrap.css file I tried lessc bootswatch.less > bootstrap.css But I got NameError: variable @navbar-default-bg is undefined in C:\Users\\Downloads\ bootswatch.less on line 16, column 14: 15 background-color: #fff; 16 color: @navbar

Wrong CSS Path - Live Reload issue with Grunt

ぃ、小莉子 提交于 2019-12-05 18:20:52
问题 I have this setup in my Gruntfile.js module.exports = function(grunt) { grunt.initConfig({ less: { development: { options: { compress: false, yuicompress: false, optimization: 0 }, files: { // target.css file: source.less file "assets/css/main.css": "assets/css/main.less" }, } }, watch: { styles: { // Which files to watch (all .less files recursively in the less directory) files: ['assets/css/*.less', 'assets/less/*.less'], tasks: ['less'], }, // Live reload CSS css: { files: ['assets/css/*

How to make less to work with basset in laravel 4?

柔情痞子 提交于 2019-12-05 17:26:15
How to enable Less compiling with basset? My basset config file collection: 'collections' => array( 'application' => function($collection) { $collection->apply('UriRewriteFilter'); $directory = $collection->directory('../app/assets/stylesheets', function($collection) { $collection->add('less/design.less')->apply('Less'); }); $directory->apply('CssMin'); } ); Everything else in config is untouched. In the source code i get this: <link rel="stylesheet" type="text/css" href="http://localhost/Job/public/ph7mOzIaRTYLhvwL/application/6f5128120be8f13c4a2109051990f113/design.css" /> Even thought it's

LESS - use nth-child variable in string

风格不统一 提交于 2019-12-05 17:14:25
问题 Surely there's a way to rewrite the following in LESS? #bg-slider{ li:nth-child(1){ background:url('../images/bg1.jpg'); } li:nth-child(2){ background:url('../images/bg2.jpg'); } li:nth-child(3){ background:url('../images/bg3.jpg'); } } I've tried: .bg-image (@slide) { background:url('../images/bg@{slide}.jpg'); } #bg-slider{ li:nth-child(n){ .bg-image(n); } } But that just gives '../images/bgn.jpg' for all li's. 回答1: #bg-slider { li { .bkg(1); .bkg(2); .bkg(3); } .bkg(@i) { &:nth-child(@{i})

LESS compile error

坚强是说给别人听的谎言 提交于 2019-12-05 16:59:21
I am using Incident57's CodeKit pre-processor to compile a series of less files that are being imported and minified into a single CSS file called template.css. However, after making some edit (and I have no idea what edit caused this) I have started to get non_object_property_callError non_object_property_callError: Cannot call method 'charAt' of null in /Volumes/Clients/htdocs/ergonomiq/domains/clients/polaris5/less/mediaqueries.less:14:2 13 h1 { 14 font-size: 100px; 15 margin-bottom: 60px; template.less imports 12 files: @import "cssindex.less"; @import "fonts.less"; @import "colors.less";

How to compile lesscss using node.js

梦想与她 提交于 2019-12-05 16:37:46
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. ItalyPaleAle You can install the LESS compiler directly from npm . Install node.js . Go to this page and download the installer for your platform. If you're on Windows, download the .msi ; if you are on OSX, download the .pkg file. Whenever

lessc: command not found

偶尔善良 提交于 2019-12-05 16:15:06
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: lessc boostrap.less and still get -bash: lessc: command not found I'm totally lost here and any help would