2

I am trying to use LESS CSS to write my CSS. I have imported the style.css and less.js file in that order.

But i am not able to generate the CSS when i write the CSS like this

@black: #231f20;
@brown: #241714;
@red: #cd0001;

#header #logo { width:224px; height: 75px; backgroud-color:@red;}

Link: http://bakasura.in/king/

Less File: http://bakasura.in/king/css/styles.less

7
  • 1
    Is this way tested and proved to have a significantly better speed? Upd. File size wise, I think you would be making a bigger difference if you eleminted spaces (like { and ; abc) and unnecessary chars like ; at the end of the style block. Commented Jun 21, 2011 at 11:03
  • according to my knowledge we need to use this only on development. so that you will have a better CSS at the end of it. Once u wanna move it into production u can use the generated CSS file by the LESS system and link to it. Commented Jun 21, 2011 at 11:04
  • 1
    It is when you have huge files. Commented Jun 21, 2011 at 11:05
  • i am using it for the first time by the way. Commented Jun 21, 2011 at 11:07
  • @Rich how to extract the generated CSS file on running the less ? Commented Jun 21, 2011 at 11:08

2 Answers 2

5

backgroud-color:@red contains a typo.

Try background-color:@red instead.

Sign up to request clarification or add additional context in comments.

Comments

2

Looking at your source you import the less.js after the styles.less

<link rel="stylesheet/less" href="css/styles.less">
<script src="js/less-1.1.3.min.js"></script>

This may or may not make any difference.

2 Comments

there was a typo.. that caused the error. to answer your point. they have to have the less file before the js file
fair enough @thirtydot, wasnt sure, just poster said that he had them in a different order. Looks like your answer did the trick

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.