Import .less from parent directory

I’ll quickly jot down how to use @import ‘path/to/file’ in LESS, because it is a little awkward on the path.

This might be something I’ve forgotten about, because I’ve probably done it before, but it just bugged me tonight, because I had to look for a solution again.

Including less files from a parent directory is easy

as long as you remember that you need to prepend ‘./’ in front of the path, which is different from webserver, linux filesystem and all kinds of other paths in the world. It would be nice if the language documentation or the compiler I’m using would state something about that.

If you don’t do this, you’ll get errors like “FileError ‘../path/to/bootstrap.less’ wasn’t found” and similar.


@import "./../flatstrap/assets/less/bootstrap";
@import "./../flatstrap/assets/less/responsive";

Anyways, it’s working out and I can proceed to writing the code of my dreams with flatstrap, a sexy twitter bootstrap clone and LESS.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>