Edit Page

tasks/config/less.js

This file configures a Grunt task called "less".

Its job is to compile your LESS files into a CSS stylesheet.

By default, only the assets/styles/importer.less file is compiled. This allows you to control the ordering yourself, i.e. import your dependencies, mixins, variables, resets, etc. before your other more application-specific styles. This is entirely up to you, and based on the order with which write your @imports in your LESS file.

But I'm not using LESS...

#

No problem!

If you aren't using any preprocessor for your stylesheets, then just ignore this file.

If you want to use a different pre-processor like SASS or Stylus, and you want Sails to process your stylesheets automatically as you work, then you're in luck. In most cases, this is as easy as installing the appropriate Grunt plugin as a dependency of your Sails app, and then configuring it to output compiled CSS to the same path as in this default task.

Here are a couple of popular examples:

Usage

#

For additional usage documentation, see grunt-contrib-less.

Want to see for yourself?

An example of this file can be found in our sample app repo, here.

Anatomy of a Sails App