Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Less compiling to empty CSS files

I've been writing less, and using Codekit to compile locally.

Everything compiles to the correct destination as it should.. but

Every time I save a less file, it creates an empty CSS file in the same location on my hard disk. This happens when Codekit is closed, so it doesn't seem to be an issue with the program itself.

I have no idea what is causing this behaviour, I have no other services running.

thanks

like image 959
amigolargo Avatar asked May 02 '12 13:05

amigolargo


People also ask

Does LESS compile to CSS?

Less (sometimes stylized as LESS) is one of the dynamic style sheet languages that can be compiled into Cascading Style Sheets (CSS), or can run on the server-side and client-side.

How you can pre compile LESS into CSS?

It allows to use of variables and provides the functionality of a programming language. But if we want to precompile LESS into CSS before using it on a web page, we can do that by using the LESS package of the npm package manager. In this way, we can use less into a simple HTML webpage.

What is the difference between CSS and LESS?

In a nutshell, less is a CSS pre-processor that encompasses the CSS language. It extends the capabilities and functions of CSS which enables using variables, features, mixins, nested rules, and operations when writing styles.

Where should CSS files be stored?

One solution is put all the css file in root-directory/css , while quite a few websites use hierarchical directory like '/skin' '/global' etc. The others choose a quite differential way using links like http://sstatic.net/stackoverflow/all.css?v=5fc0e3026fcc (this is the stackoverflow way).


1 Answers

For others that get this problem, it's usually a missing or duplicate semicolon on a property or something simple that causes this particular issue. The hard part is tracking down the specific error, so your best bet is to try a couple of different compilers and hope for an error log that tells you at least which .less file is causing the problem. Try node.js with lessc, less.app, winless or whatever else is available to you on your OS. This is a common issues, so it's worthwhile to have another "backup" compiler handy to debug.

like image 89
2 revs Avatar answered Sep 24 '22 22:09

2 revs