Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| devweb:less [21-09-2013 19:56] – créée edmc73 | devweb:less [08-02-2015 21:29] (Version actuelle) – [Méthode la plus simple] edmc73 | ||
|---|---|---|---|
| Ligne 4: | Ligne 4: | ||
| ===== Installation ===== | ===== Installation ===== | ||
| + | |||
| + | ==== Méthode la plus simple ==== | ||
| + | |||
| + | apt-get install node-less | ||
| + | |||
| + | |||
| + | ==== Méthode plus longue... ==== | ||
| # être root | # être root | ||
| Ligne 10: | Ligne 17: | ||
| # Download latest version of node.js\\ | # Download latest version of node.js\\ | ||
| - | # please replace the url with the newest available version, which you can find here http:// | + | # please replace the url with the newest available version, which you can find here http:// |
| wget http:// | wget http:// | ||
| Ligne 18: | Ligne 25: | ||
| # change working directory | # change working directory | ||
| cd node-v0.4.7 | cd node-v0.4.7 | ||
| - | |||
| # configure | # configure | ||
| Ligne 30: | Ligne 36: | ||
| - | # go back to home | + | Installer less |
| - | cd ~ | + | |
| + | npm install -g less | ||
| + | | ||
| + | <note tip>When you run " | ||
| + | You can run " | ||
| - | # download less | + | If you get an error that no openSSL is not available you can either configure it without them (--without-ssl) or you can install libssl by running: |
| - | wget --no-check-certificate https:// | + | apt-get install libssl-dev< |
| + | ===== Utilisation ===== | ||
| - | # extract | + | Command-line usage |
| - | tar xfvz cloudhead-less.js-v1.0-336-g853604a.tar.gz | + | |
| + | Once installed, you can invoke the compiler from the command-line, | ||
| - | | + | |
| - | mv lesscss/ /usr/local/ | + | This will output the compiled CSS to stdout, you may then redirect it to a file of your choice: |
| + | $ lessc styles.less > styles.css | ||
| + | | ||
| + | Pour minifier le code, il faut installer YUI Compressor | ||
| + | $ aptitude install yui-compressor | ||
| + | | ||
| + | To output minified CSS, simply pass the **-x** option. If you would like more involved minification, | ||
| - | cd / | + | To see all the command line options run lessc without parameters. |
| - | ln -s ../ | + | |
| + | Un petit script pour automatiser tout ça | ||
| + | <code bash> | ||
| + | #!/bin/bash | ||
| + | cd `dirname $0` | ||
| + | lessc --yui-compress public/ | ||
| + | </ | ||
| + | ===== Mixins library ===== | ||
| + | |||
| + | http:// | ||
| + | |||
| + | To use:\\ | ||
| + | Download the " | ||
| + | Place it in the same folder with your other LESS files.\\ | ||
| + | Reference it at the top of your LESS stylesheets with:\\ | ||
| + | |||
| + | @import " | ||
| - | / | ||
| - | When you run " | ||
| - | You can run " | ||
| - | If you get an error that no openSSL is not available you can either configure it without them (--without-ssl) or you can install libssl by running: | ||
| - | apt-get install libssl-dev | ||
| + | https:// | ||