less

Is it possible to inline LESS stylesheets?

守給你的承諾、 提交于 2019-11-29 00:53:21
For example, is it possible to do something like: <style type="text/less"> #foo { .bar { font-weight: bold; } } </style> This has been possible since July 2010, and it works with today's Less 1.2.0 version. See the initial diff that added support for this . Otto Coster You actually need to use <style type="text/less"> instead of: <style type="stylesheet/less"> Otherwise it won't work. Remember to place the <style> element before the <script> element to load less.js. 来源: https://stackoverflow.com/questions/7731702/is-it-possible-to-inline-less-stylesheets

Less isn't showing me its errors

不羁的心 提交于 2019-11-28 23:13:24
When using client-side compilation for less, and if there are errors, Less is not showing me what those errors are. It's supposed to insert some HTML, but it seems not to be doing this. The HTML on the page after Less runs looks like: <html> <head> <link rel="stylesheet/less" type="text/css" href="/Content/less/all.less"> <script src="/Content/js/libs/less-1.3.0.min.js" type="text/javascript"></script> <style type="text/css" media="screen" id="less:error-message"> --SNIP-- }</style> </head> <body> </body> </html> As you can see, the less error css is generated, but not the html. Add this

How we can use @font-face in Less

心已入冬 提交于 2019-11-28 22:29:40
In Less , it seems almost impossible to use @font-face selector. Less gives errors when I try to use font-family: my_font Here is how I try to use it: @font-face { font-family: my_font; src: url('http://contest-bg.net/lg.ttf'); } p { font-family: my_font, "Lucida Grande", sans-serif; } There is simple escape in Less using ~"..." but can't come up with working code. Had someone used it successfully? Have you tried putting the font family name in single quotes? The following works just fine for me. @font-face { font-family: 'cblockbold'; src: url('assets/fonts/creabbb_-webfont.eot'); src: url(

How to add *.less to IIS 7.0?

左心房为你撑大大i 提交于 2019-11-28 22:03:27
问题 I have set up a virtual application on my localmachine and it is running but it's not loading the CSS file. And I am using the lessCSS for styling my application and I think the reason here for not loading the css here is that LESSCSS style sheet uses .less extension. So what to do in order to read *.less file extension? 回答1: There is no need to add a handler. Just add a MIME type (now known as Internet Media Type) for .less and set the MIME type to text/css . Web servers see the extension of

Color operations in less

天涯浪子 提交于 2019-11-28 21:59:17
I'm already using color theme in my website, where, for example I have a standard hex color for link states regular/hover/active. Now I want to use color operations in LESS like color:darken(@base_color, x%); So my question is: If I know my base color and my output color after the 'darken' operation, how do I know what % to give the darken operation to produce my output color? eg: If i'm going from #952262 -> #681744 what would be my %? Maybe there's a site that does these conversions? Hopefully the answer is not 'Trial and error'. Has A Few Challenges and Caveats Normally, people do not use a

UVA 10852 Less Prime 题解

眉间皱痕 提交于 2019-11-28 21:49:10
Less Prime Let n be an integer, 100 n 10000, nd the prime number x, x n, so that n 􀀀 p x is maximum, where p is an integer such that p x n < (p + 1) x. Input The rst line of the input contains an integer, M, indicating the number of test cases. For each test case, there is a line with a number N, 100 N 10000. Output For each test case, the output should consist of one line showing the prime number that veries the condition above. Sample Input 5 4399 614 8201 101 7048 Sample Output 2203 311 4111 53 3527 题意:给出一个n,问:n-p*x 取最大值时x的值是多少,其中p满足p*x<=n<(p+1)*x。 根据p*x<=n<(p+1)*x可以得出n-px的值一定小于x,所以对n-p

Java Compiler for Less CSS?

我只是一个虾纸丫 提交于 2019-11-28 21:13:42
I am looking for Java-based Less CSS compilers. On Github, I have stumbled across lesscss4j lesscss-java Both are from the same developer. Unfortunately I cannot quite figure out the difference between them. Can somebody tell me? Which other compilers do you know? LESS Engine wraps the javascript compiler in a straight-forward Java interface. I haven't used lesscss-java, so I can't comment on relative quality, but in the small tasks I've needed, I've had no complaints with Less Engine. The Official LESS CSS Compiler for Java is pretty nice, too. It's in Maven Central, is thread safe (so

Grunt, Less, and File Watching

六眼飞鱼酱① 提交于 2019-11-28 21:03:02
问题 I'm trying to get grunt working to do something. My project looks like this: /app /assets /components /stylesheets /less /file1.less /file2.less /file3.less /importAll.less /css I want it so that when file1 , file2 , or file3 are saved the importAll.less file is compiled into css and put into /css/style.css . This is as far as I got. less: { development: { options: { paths: ["./assets/stylesheets/less"], yuicompress: true }, files: { "./assets/stylesheets/css/style.css": "./assets/stylesheets

wrap a .less css definitions in a namespace

淺唱寂寞╮ 提交于 2019-11-28 20:16:16
问题 I wanted to use twitter bootstrap CSS only in a specific element in my web page. I tried to do it like in code below. But after compiling this to a css file nothing was outputted. If I moved @import outside #my_div then I got all css definitions for twitter boostrap. #my_div { @import "../twitter_bootstrap/lib/bootstrap.less"; } How can I namespace a less css file? 回答1: I am not using less on the live site, nor am I manually doing the compiling so this is kind of a "simple" version. It's not