less

Is it possible to pass !important as parameter/option for LESSCSS mixins?

只谈情不闲聊 提交于 2019-11-29 05:02:01
This is what I already have: .coloring(@color){ color:@color; } But this is what I actually wanted to do: .coloring(@color, @important:''){ color:@color @important; //etc } So I could call: .coloring(@color, !important); But I get the error message "ParseError: Unrecognised input" Is there a way to tell this mixin optoinally to use "!important" for the CSS statements? See The !important keyword . E.g. can just use .coloring(red) !important; w/o mixin changes. Or use escaping for the modified mixin since ! is not allowed symbol in mixin parameter values (i.e. .coloring(red, ~'!important'); ).

rem适配布局(rem+less+媒体查询 和 rem+flexible.js)

人盡茶涼 提交于 2019-11-29 04:10:35
1. rem 基础  rem 是一个相对单位,类似于 em ,em 是父元素字体大小。  em 是相对于父元素 的字体大小来说的  rem 是相对于 html 元素 字体大小来说的  rem 优点 就是可以通过修改 html 里面的文字大小来改变页面中元素的大小可以整体控制  比如:根元素(html )设置的 font-size=12px;非根元素设置 width:2rem;则换成px 表示 24px(12px*2rem) 2. 媒体查询(@media)  @media 可以针对不同的屏幕尺寸设置不同的样式  语法规范:   @media mediatype and | not | only (media feature){     CSS - Code;   } 用 @media 开头 mediatype 媒体类型     all:用于所有设备,     print:用于打印机和打印预览,     screen:用于电脑屏幕,平板电脑,手机等 关键字 and not only     and:可以将多个媒体特性连接到一起,相当于“且”的意思     not:排除某个媒体类型,相当于“非”的意思,可以省略     only:指定某个特定的媒体类型,可以省略 media feature 媒体特性 必须有小括号包含     width:定义输出设备中页面可见区域的宽度     max

FontAwesome - Failed to decode downloaded font

陌路散爱 提交于 2019-11-29 03:49:10
I found allready this: https://stackoverflow.com/search?q=Failed+to+decode+downloaded+font But the Answers dont help to fix my problem =/ I got on my page this errors in console: Failed to decode downloaded font: http://devcomlink.kunena.dev-monkeys.com/components/com_kunena/template/devcomlink/fonts/font-awesome/fontawesome-webfont.woff2 index.php?option=com_kunena&view=category&layout=list&Itemid=129&templateStyle=9:1 Failed to decode downloaded font: http://devcomlink.kunena.dev-monkeys.com/components/com_kunena/template/devcomlink/fonts/font-awesome/fontawesome-webfont.woff index.php

Refactoring and removing unused CSS from SASS/LESS files

心不动则不痛 提交于 2019-11-29 03:03:20
问题 I am working on a big single page application [backbonejs and rails] which has LESS as the CSS preprocessor and the generated .css files has grown to such an extent that for IE we have to split it into 3 files with http://blesscss.com/ Though there are tools to detect unused css and linting css, I am unable to find a proper solution for refactoring LESS/SASS files directly from uncompiled files instead of a single large generated .css file. Would like to know what is the best approach doing

Compile less files with grunt-contrib-less won't work

隐身守侯 提交于 2019-11-29 02:34:13
问题 I'm using Grunt for building my web project. I installed grunt-contrib-less package und added a task to my grunt.initConfig({..}); less : { options: { paths: ['js/base'] }, files: { 'js/base/*.css' : 'js/base/*.less' } } when I run the target less via grunt less , it runs without errors but doesn't compile the less file to a css file. Running "less:files" (less) task Done, without errors. I have installed the lessc package via node, too. Doing lessc <source> <dest> works fine. Currently I

Using Grunt grunt-contrib-less) for compiling Bootstrap 3.1 LESS in Visual Studio 2013

我是研究僧i 提交于 2019-11-29 01:55:33
问题 I used the following as pre-build event in Visual Studio 2013 to compile Bootstrap 3.0 with recess according to this answer and it worked recess "$(ProjectDir)Content\bootstrap\bootstrap.less" --compress > "$(ProjectDir)Content\bootstrap-compiled.css" Now this doesn't work for Bootstrap 3.1.1 and they say Grunt will do it. I've tried: grunt-contrib-less "$(ProjectDir)Content\bootstrap\bootstrap.less" --compress > "$(ProjectDir)Content\bootstrap-compiled.css" But can't get it to work. Any

Can you do a javascript for loop inside of LESS css?

我的未来我决定 提交于 2019-11-29 01:46:23
I am looking to do a for loop inside of Less. Is it possible to do this inside of Less? I know it has the capability to evaluate js but to this degree? I will recommend to checkout Twitter Bootsrap . They are building their grid system that way. They loop, with recursion, in a less mixin, instead of typing every class they need. The interesting part is in mixins.less file, in the less directory, below "// The Grid" comment (line 516). The interesting portion is: #grid { .core (@gridColumnWidth, @gridGutterWidth) { .spanX (@index) when (@index > 0) { (~".span@{index}") { .span(@index); } .spanX

Less Immediate Parent Selector

安稳与你 提交于 2019-11-29 01:39:20
问题 Less allows one to select the parent selector (http://lesscss.org/features/#parent-selectors-feature) How does one get the immediate parent selector, not the root parent selector? 回答1: A Base Example It partly depends upon how you structure your LESS code. There is currently no way to do this with a normal nested structure. However, take the following example, where the .grandchild is our final target in all cases (it must be the outermost level--I called this "end target grouping" in a

Join two .less files into one css file

廉价感情. 提交于 2019-11-29 01:14:51
When working with lesscss I would like to join two or three .less files into one super css file. I know that you can do it using some little ruby magic , but I would like to know if there is something simple in the less engine? Dan Herbert You can use import , similar to how you can in a regular CSS file. @import "reset"; @import "config"; @import "header"; @import "forms"; Taken from this SO post . It's also mentioned in the "Importing" section of the Less Documentation . Simple solution: Create a main.less file and open it (name it as you like) Import your other css and less files via

Where to find the twitter bootstrap less files?

隐身守侯 提交于 2019-11-29 01:07:48
I'm trying to find a relatively easy way of adding padding to my containers with Twitter Bootstrap. All works well but at some resolutions, the window doesn't fit the screen. I figure I have to go and compensate for the padding by removing some of the width from various span classes? This is quite hard work, just the mathematics alone is problematic. For this reason, perhaps it's best to use the less file that Bootstrap apparently comes with. The only problem is I can't seem to find them anywhere. Do these files actually exist? Unfortunately I only know how to use Less through an app like