Source:
* https://github.com/leafo/lessphp/blob/b7cd5c79e8/lessc.inc.php
* 261f1bd2...b7cd5c79e8
Updates:
* 1d62556008: CS fixes
* d3fd5cec9e: use the built-in php magic database instead of the system one
* 34fdf60f32: data-uri: add tests and use lessc::findImport to locate the file
* 72b25725d9: implement data-uri([mimetype,] url) from less.js 1.4.0
* 5cf7eb272e: Update lessc.inc.php
* 7e64e41a59: Fix color contrast and threshold calculation
* 69adc23a92: Use property_exist to avoid "Undefined property: stdClass::$parent"
Change-Id: Ie626b4f1117b44669bd2c6c43a0186d95b36435a
From https://github.com/leafo/lessphp/blob/261f1bd28f/lessc.inc.php
Changes, 6e8e724fc7..261f1bd28f:
* 261f1bd Merge pull request #480 from atdt/master
* 0f85200 Miscellaneous small touch-ups
* 5504066 Improve handling of /* comments */ when 'preserveComments' is set
* 667702c Make function helpers public
Bug: 54673
Change-Id: Ib6bc76736d460081dc8f48aee09ca32066dae296
Summary of changes:
- lessphp throws errors when referencing undeclared variables and mixins.
- lessc::addParsedFile is now public.
See <785ad53840...6e8e724fc7>.
Change-Id: Idffe6946f4029659e677f9dfb62566096cc8d5b5
This patch updates lessc.inc.php to 785ad53840:
<785ad53840>.
Differences from our version:
- Updated year in copyright notice
- Added support for 'precision' parameter to round().
Change-Id: If22afea96741c6d8fedefc05c49b24ae6e7809b0
This patch adds support for the LESS stylesheet language to ResourceLoader.
LESS is a stylesheet language that compiles into CSS. The patch includes
lessphp, a LESS compiler implemented in PHP. The rationale for choosing LESS is
explained in a MediaWiki RFC which accompanies this patch, available at
<https://www.mediawiki.org/wiki/Requests_for_comment/LESS>.
LESS support is provided for ResourceLoader file modules. It is triggered by
the presence of the '.less' extension in stylesheet filenames. LESS files are
compiled by lessc, and the resultant CSS is subjected to the standard set of
transformations (CSSJanus & CSSMin). The immediate result of LESS compilation
is encoded as an array, which includes the list of LESS files that were
compiled and their mtimes. This array is cached. Cache invalidation is
performed by comparing the cached mtimes with the mtimes of the files on disk.
If the compiler itself throws an exception, ResourceLoader constructs a
compilation result which consists of the error message encoded as a CSS
comment. Failed compilation results are cached too, but with an expiration time
of five minutes. The expiration time is required because the full list of
referenced files is not known.
Three configuration variables configure the global environment for LESS
modules: $wgResourceLoaderLESSVars, $wgResourceLoaderLESSFunctions, and
$wgResourceLoaderLESSImportPaths. $wgResourceLoaderLESSVars maps variable names
to CSS values, specified as strings. Variables declared in this array are
available in all LESS files. $wgResourceLoaderLESSFunctions is similar, except
it maps custom function names to PHP callables. These functions can be called
from within LESS to transform values. Read more about custom functions at
<http://leafo.net/lessphp/docs/#custom_functions>. Finally,
$wgResourceLoaderLESSImportPaths specifies file system paths in addition to the
current module's path where the LESS compiler should look up files referenced
in @import statements.
The issue of handling of /* @embed */ and /* @noflip */ annotations is left
unresolved. Earlier versions of this patch included an @embed analog
implemented as a LESS custom function, but there was enough ambiguity about
whether the strategy it took was optimal to merit discussing it in a separate,
follow-up patch.
Bug: 40964
Change-Id: Id052a04dd2f76a1f4aef39fbd454bd67f5fd282f