less

LESS mixins with multiple arguments

老子叫甜甜 提交于 2019-12-09 06:09:27
I have this little mixin set up: .linear-gradient(@direction:top, @color1:#fff, @color2:#000) { background-image: -webkit-linear-gradient(@direction, @color1, @color2); } Then, in my main.less I'm trying something like this: a { .linear-gradient(top, #999, #666); } That works fine, by say I want to do something like this: a { .linear-gradient(top, , #666); } Now, the first color should default to its default mixin color. How do I do this? Is this even possible Less isn't quite that clever. You can either be explicit: .linear-gradient(top, #fff, #000); or use a variable as an abstraction to

How to compile Bootstrap LESS source in VS 2013

a 夏天 提交于 2019-12-09 05:43:12
问题 I have visual studio 2013 Ultimate Update 4 plus Web Essentials installed and updated. I download bootstrap V3.3.1 source I copied the css, js, fonts and less folder to visual studio. Now I want to compile all .less files after my edits there to overwrite the bootstrap.css file, I selected all files in solution explorer and right click but all Web Essentials menu items disabled. What are the steps I should follow to compile all files to .css file or should I use a different tool than Web

Import LESS from server

早过忘川 提交于 2019-12-09 03:19:30
问题 In my ASP.NET MVC application I have an action that returns LESS variables. I would like to import these variables into my main LESS file. What is the recommended approach for doing this since DotLess will only import files with .less or .css extensions? 回答1: I found the easiest solution was to implement IFileReader . The implementation below makes a HTTP request to any LESS path prefixed with "~/assets", otherwise we use the default FileReader . Note that this is prototype code: public class

Concatenating arbitrary number of values in lesscss mixin

会有一股神秘感。 提交于 2019-12-09 00:45:48
问题 Standard lesscss mixin: .box-shadow(@val) { -moz-box-shadow: @val; box-shadow: @val; } However, in pure CSS I'm able to use several box shadows on one element, e.g. #myBox { box-shadow: inset 0px 1px 0px white, 0px 0px 5px #aaa; -moz-box-shadow: inset 0px 1px 0px white, 0px 0px 5px #aaa; } To ie. create an inset and glow effect. Of course I want to use lesscss to remedy the vendor-prefix curse in this case too, but .box-shadow() { -moz-box-shadow: @arguments; box-shadow: @arguments; } #myBox

Grunt 0.4 less task : How to not concatenate destination files

大兔子大兔子 提交于 2019-12-08 23:34:41
问题 I want to generate .css partial files from the corresponding .less files I use the latest versions available from npm, grunt@0.4.0, grunt-contrib-less@0.5.0 Prior to Grunt version 0.4 I could simply specify the pattern: htdocs/less/*.less as source htdocs/css/*.css as destination and all the files from the folder htdocs/less would be generated into the folder htdocs/css Since v0.4 the destination pattern does no longer work, all files from the folder htdocs/less are concatenated into one file

Less.js LoadError - no such file to load — less on main .less file

大憨熊 提交于 2019-12-08 21:13:40
问题 I am trying to test out less.js on a new project. I am 100% sure the javascript file is loading fine but I keep getting this error on the less file that is in my css folder. I am going to compile it using the less.app before I launch but I would rather just let less.js do it during development. Is there a problem with it not letting the browser access the file since it is .less or something else? Thanks (running ubuntu 11.04 and ruby v1.9.2, same error in firefox and chrome) Here is my head

Can I use LESS with Xul?

烂漫一生 提交于 2019-12-08 19:46:27
问题 Can I use LESS with Xul? Does anyone already used them together? 回答1: I haven't seen anyone use it, but nothing stops you from trying. LESS is just a preprocessor, which outputs CSS files, so the kind of problems you could expect to find should be with Mozilla-specific CSS constructs, that you might need to use. I bet any such problems would not be very hard to fix. On the other hand, unless you're working on something as complex as writing a theme from scratch, I wouldn't expect LESS to

Define variables in one LESS file

北战南征 提交于 2019-12-08 19:15:04
问题 I've just started using LESS to simplify my CSS stuff. I want to be able to define the colours in one file, so I can have several colour schemes that I can switch between just by changing which file is being referenced. I tried something like this: <link rel="stylesheet/less" href="/css/colours.less" /> <link rel="stylesheet/less" href="/css/styles.less" /> But I get "variable not defined" errors in the styles.less file. I can "fix" this by using import "/css/colours.less" at the start of

Override LESS variables

蓝咒 提交于 2019-12-08 18:55:04
问题 I have the following stack: Symfony2 Twig with lessphp filter installed. Twitter Boostrap In base.css i have: // base.less @import '/path/to/bootstrap.less' @linkColor: 13px; Variable name is not important at all. It can be any other variable used in bootstrap. It just doesn't get overridden. But if i put the variable into separate .less file and import it in base.less everything works as expected: // base.less @import '/path/to/bootstrap.less' @import '/path/to/variables.less' and //

Undeclared variable with LESS @import. What is causing this? Is there a fix?

China☆狼群 提交于 2019-12-08 18:24:11
问题 I have 2 LESS files. Globals.less and Site.less. Globals.less contains all of my global (go figure) variables and an import to a CSS reset definition. Site.less contains the styles in use. Globals.less: //Imports @import "CSSReset.less"; //Colors @color-background: rgb(0, 0 , 0); Site.less: @import "Globals.less"; body { background: @color-background url('/Images/BackgroundTextureBody.png'); } The problem is this: In Visual Studio @color-background in Site.less is underlined and the error is