Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Compare: Home

Showing with 31 additions and 1 deletion.
  1. +31 −1 Home.md
View
32 Home.md
@@ -271,7 +271,37 @@ Now whenever the build script is creating a publish directory for you it will at
* @import URLs that start with http: or https: need to come before any @imports that will be inlined, otherwise they will break (see the strict rules above).
* You can specify media types after an @import (ex: `@import url('print.styles.css') print;`). The build script will wrap these in an `@media [type]{[file contents]}` block.
-## Some notes
+## Compiling LESS CSS (http://lesscss.org/)
+
+The build script can now optionally compile your LESS code into CSS ready for use on a production site.
+Currently the script will only work on LESS code in your main stylesheet, so if you want to process more than one stylesheet you must use `@import` references in this file.
+
+To enable the LESS compiler, in `project.properties` your must set `file.root.stylesheet` to the name of your LESS stylesheet and `build.css.less` to true.
+
+Example `project.properties`
+```
+...
+file.root.stylesheet = style.less
+build.css.less = true
+...
+```
+
+Now when you run ant your LESS code will be compiled, and as it replaces the main stylesheet your code will also be minified and have a new hashed filename.
+
+### Tidying up LESS references in your HTML
+
+To make the build script remove references to your LESS JavsScript from your HTML wrap it in a comment block like so.
+
+```html
+<!-- less script -->
+ <script>var less = { env: ‘development’ };</script>
+ <script src="js/vendor/less-1.3.0.min.js"></script>
+<!-- end less script -->
+```
+
+The build script will also change the rel attribute of your main stylesheet link to `stylesheet` from `stylesheet/less`.
+
+### Some notes
* The build script makes some assumptions about how your javascript files are sorted.
* `/js/libs/` contains files from boilerplate. These are minified but not concatenated with others. Modernizr should be alone in the head. jQuery might be pulled off the CDN.
Something went wrong with that request. Please try again.