Bachir Soussi Chiadmi 1c16557c5f less module modification, dont know if i have to keep it | 8 роки тому | |
---|---|---|
.. | ||
classes | 8 роки тому | |
engines | 8 роки тому | |
includes | 8 роки тому | |
less_demo | 8 роки тому | |
scripts | 9 роки тому | |
styles | 9 роки тому | |
tests | 9 роки тому | |
.gitignore | 9 роки тому | |
LICENSE.txt | 9 роки тому | |
README.md | 9 роки тому | |
composer.json | 9 роки тому | |
less.api.php | 9 роки тому | |
less.drush.inc | 9 роки тому | |
less.info | 8 роки тому | |
less.install | 9 роки тому | |
less.module | 9 роки тому |
This module allows for automatic compilation of LESS styles sheets.
LESS requires at least one of three possible engines available:
This is a pure PHP implementation, which is good for shared hosting, or if you don't feel comfortable installing or configuring software on your server.
It lacks the ability to execute javascript embedded in .less files, so some LESS libraries might not work.
Requirements:
Less.php
is located at sites/all/libraries/less.php/Less.php
You can read about how to install here: less.js
Please read Command Line Requirements to ensure that less.js is installed properly.
leafo/lessphp Deprecated
leafo/lessphp library unpacked so that lessc.inc.php
is located at sites/all/libraries/lessphp/lessc.inc.php
.
This library is no longer recommended as it lacks support for a majority of new features in the latest canonical LESS.
Once installed, you must select your engine on 'admin/config/development/less'.
Less engines written in PHP do not support embedded JavaScript evaluation.
Write your CSS rules without vendor prefixes (in fact, forget about them entirely)
Autoprefixer will use the data based on current browser popularity and property support to apply prefixes for you.
Please read Command Line Requirements to ensure that autoprefixer is installed properly.
Both less.js and postcss/autoprefixer require that PHP can call these programs directly from the command line.
It is up to the installer (you) to ensure that the lessc
and/or autoprefixer
are able to be called by PHP without a full path to the binary.
Thus is it required that you configure your PATH for the user that your PHP installation runs under to ensure that these programs can be run by name without the full path.
LESS Development:
Syntax: http://lesscss.org/features/
File placement:
If your source file was sites/all/modules/test/test.css.less
Then your compiled file will be sites/[yoursite]/files/less/[random.string]/sites/all/modules/test/test.css
The following two examples provide equivalent functionality.
<?php
$module_path = drupal_get_path('module', 'less_demo');
drupal_add_css($module_path . '/styles/less_demo.css.less');
?>
stylesheets[all][] = styles/less_demo.css.less
For automatic variable and function association with non globally added stylesheets, you can associate a stylesheet using this notation in .info files:
less[sheets][] = relative/path/to/stylesheet.css.less
Should work with most themes and caching mechanisms.
Fully compatible with "Optimize CSS files" setting on "Admin->Site configuration->Performance" (admin/settings/performance).
RTL support will work as long as your file names end with ".css.less".
Assuming your file is named "somename.css.less", Drupal automatically looks for a file name "somename-rtl.css.less"
Variable defaults can be defined in .info files for modules or themes. Any variables defined will be automatically available inside style sheets associated with the module or theme.
.info file:
less[vars][@varname] = #bada55
Look in less.api.php for LESS Variable hooks.