less

On input of long escaped property value in LESS, how to split it to a newline

我怕爱的太早我们不能终老 提交于 2019-12-25 04:22:17
问题 Suppose I have a really long escaped property value to input in LESS. I can get it to output with newlines in the final formatted css by setting a variable to add a newline like so @nl: `"\n"`; and use that in my escaped string to output newlines in the property value. So this: @nl: `"\n"`; .test { property: ~"one,@{nl} two"; } Will output this: .test { property: one, two; } The question is whether there is any way to input it with newlines, something like: .test { property: ~"one, two"; }

Dynamic Variable Names with Less

非 Y 不嫁゛ 提交于 2019-12-25 04:12:06
问题 I'm trying to assign some dynamic variable names using less (using it for the first time) ... but nothing I've tried seems to work. After looking through all the documentation, I came up with this, but it's still not working: // jellybeans @opacity: 1; @black-jellybeans: rgba(59,59,59,@opacity); // #3b3b3b @red-jellybeans: rgb(207,106,76,@opacity); // #cf6a4c @green-jellybeans: rgba(153,173,106,@opacity); // #99ad6a @yellow-jellybeans: rgba(216,173,76,@opacity); // #d8ad4c @blue-jellybeans:

Converting css to less

人走茶凉 提交于 2019-12-25 04:08:51
问题 I am trying to convert some css to less, but on compile i got some errors? Here is what i have in css, how to convert this to less #preloader { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: #2AABE2; background: rgba(42, 171, 226, 0.5); display: none; -khtml-opacity: 0.80; opacity: 0.80; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha"(Opacity=60); filter: progid:DXImageTransform.Microsoft.Alpha(opacity=60); filter:alpha(opacity=60); z-index: 20000; text-align: center;

Compile variables.less file to where? FLAT UI

天涯浪子 提交于 2019-12-25 03:37:10
问题 I'm pretty new to the use of .less files. I downloaded a FLAT UI bootstrap. Now I wanted to change the base color of the bootstrap and therefor I used the variables.less file. There I changed the brand-primary to an other colorscheme. Now I read everywhere I need to compile this file. But to where do I need to compile this because there is no variables.css file available only there is a bootstrap.css file and flat-ui.css file. I'm I seeing something wrong here? It's about this bootstrap: http

LESS to SASS Ampersand Workaround

本小妞迷上赌 提交于 2019-12-25 03:22:42
问题 I'm working on a less to sass conversion and have a few instances of classes on the html tag that I need to use to modify the styling of a particular class: .shell { width: 100%; ... .medium-viewport & { width: 800px; .lt-ie8& { width: 750px; } ... } .wide-viewport & { width: 950px; ... } ... } I want to join the lt-ie8 class with the medium-viewport class: .lt-ie8.medium-viewport .shell {width: 750px;} Some of the files have a lot of rules in them for different conditions coming in on the

How to change gutter widths on Responsable CSS Grid

与世无争的帅哥 提交于 2019-12-25 03:16:33
问题 I am using the ResponsableCSS (.com) grid for LESS. It all works great, the only problem I have is that I can't amend the gutter widths so that if I have the following: - Two divs side by side split into 2 columns using: - header { div { .column(6); } } The overall grid is 12 divided by 6 = 2 But I want to show the divs side by side with no gutter on the left on the first element and no gutter on the right on the second element. This would enable me to have 2 elements side by side with a

Bootstrap less - override entire class

℡╲_俬逩灬. 提交于 2019-12-25 02:53:13
问题 I am using the Bootstrap less files. I would rather not modify them directly, since this seems to be bad practice. The only file I am editing is bootstrap.less since I need to add in override classes. In type.less I want to modify this: .page-header { padding-bottom: ((@line-height-computed / 2) - 1); margin: (@line-height-computed * 2) 0 @line-height-computed; border-bottom: 1px solid @page-header-border-color; } So I have created a new _type.less containing this: .page-header { background:

Less dynamic class-names generated at runtime, or classes generated from array loop

折月煮酒 提交于 2019-12-25 02:25:32
问题 Currently, one of my developers have developed this less file: .countryFlag( @countryName :"DK"){ content: url("/images/flags/@{countryName}.gif") no-repeat center; } a.flag-DK { .countryFlag (); } a.flag-DE { .countryFlag (DE); } a.flag-EE { .countryFlag (EE); } ... with some 20 countries. I was wondering if this can be done smarter with less, either using loops or dynamic names created at runtime. Consider the following pseudo-code that describes what I want: a.flag-@{country} { content:

undefined_methodError on less css code in phonegap application running on 2.2 android

被刻印的时光 ゝ 提交于 2019-12-25 02:23:02
问题 I spend quite some time everyday on stackoverflow. This place is really great! But this is my very first question, so every advice about it is very welcome :) I'm working on a mobile app using phonegap. I use less css and it works fine on my nexus 5, but I have an error related to less on my old htc desire under android 2.2 : undefined_methodError: Object function(a,b){return b instanceof Array?a=this.flatten(b,a):a.push(b),a} has no method 'bind' in index.less on line null, column 0: 1 //

lesscss - Are mixins also “Lazy loaded” like variables?

强颜欢笑 提交于 2019-12-25 01:56:23
问题 I just found out that variables in less are "lazy loaded" (as discribed here: http://lesscss.org/features/#variables-feature-lazy-loading ) in the sense that if you set up a variable, use it and then set it to another value the complied code will use that last set value. i.e. @w: 30%; .myclass { width: @w; } would compile to: .myclass { width: 50% } would the same apply to mixins? i.e. will .mycolor() { color: red; } .myclss { .mycolor() } .mycolor() { color: blue; } compile to: (no lazy)