Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente Dernière révision Les deux révisions suivantes | ||
devweb:less [21-09-2013 21:56] edmc73 créée |
devweb:less [03-02-2015 17:14] edmc73 [CSS3] |
||
---|---|---|---|
Ligne 4: | Ligne 4: | ||
===== Installation ===== | ===== Installation ===== | ||
+ | |||
+ | ==== Méthode la plus simple ==== | ||
+ | |||
+ | apt-get install python g++ make checkinstall | ||
+ | src=$(mktemp -d) && cd $src | ||
+ | wget -N http:// | ||
+ | tar xzvf node-latest.tar.gz && cd node-v* | ||
+ | ./configure | ||
+ | checkinstall -y --install=no --pkgversion 0.10.25 | ||
+ | dpkg -i node_* | ||
+ | |||
+ | Installez less | ||
+ | npm install -g less | ||
+ | |||
+ | Pour désinstaller | ||
+ | dpkg -r node | ||
+ | |||
+ | |||
+ | ==== Méthode plus longue... ==== | ||
# être root | # être root | ||
Ligne 10: | Ligne 29: | ||
# 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 37: | ||
# change working directory | # change working directory | ||
cd node-v0.4.7 | cd node-v0.4.7 | ||
- | |||
# configure | # configure | ||
Ligne 30: | Ligne 48: | ||
- | # 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:// |