LESS does not compile .less file properly

Questions and tutorials related to Cascading Style Sheets *all versions*

Moderators: egami, macek, gesf

Post Reply
jiros1
New php-forum User
New php-forum User
Posts: 4
Joined: Fri May 27, 2016 11:45 pm

Wed Sep 28, 2016 11:23 am

Hi,
thank you for taking your time reading this.

I'm trying to get started with the LESS CSS pre-compiler and I've got my environment up and running but when I compile this code:

Code: Select all

@fontColor: green;
h1{
	color: $fontColor;
}
I get the same CSS code except for the first line:

Code: Select all

h1{
	color: $fontColor;
}

I used this command:

Code: Select all

lessc styles.less styles.css
This is my HTML code:

Code: Select all

<!DOCTYPE html>
<html>
<head>
	<title></title>
    <link href="styles.css" rel="stylesheet">
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/less.js/2.7.1/less.min.js"></script>
</head>
<body>

<h1>This is a test, and the color is Green</h1>

</body>
</html>
When I open my firefox developer tools (F12) and look to the console tab I see the following message:

Code: Select all

Less has finished and no sheets were loaded.
My goal for the moment, I want the H1 text to be green, but it looks like my compiler doesn't really compile my CSS code.

Any help is much appreciated.

Post Reply