Commit graph

7 commits

Author SHA1 Message Date
Siebrand Mazeland
c0c39640e4 Make phpcs-strict pass on includes/ (5/~10)
Change-Id: I259f3f11cfc22f3ed1693f9ebd5bd80491b8a6e8
2014-05-11 19:35:32 +00:00
Erik Bernhardson
5ad0cd9b89 Update lessphp to 2cc77e3c7b
Source:
* b7cd5c79e8...2cc77e3c7b
* 2cc77e3c7b/lessc.inc.php

Updates:
* 84b1fda0d4 Set visibility of lessc::compileValue to 'public'

Change-Id: I499ddb01a662896fdcfe56d18021de5314e4d5d2
2014-04-23 03:30:02 +00:00
Ori Livneh
7068472282 Update lessphp to b7cd5c79e8
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
2014-03-07 00:27:37 +00:00
Ori Livneh
bad276d1ee Update lessphp to 261f1bd28
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
2013-10-04 00:22:07 +00:00
Timo Tijhof
34ce163fbb lessphp: Update to upstream 6e8e724fc7
Summary of changes:

- lessphp throws errors when referencing undeclared variables and mixins.
- lessc::addParsedFile is now public.

See <785ad53840...6e8e724fc7>.

Change-Id: Idffe6946f4029659e677f9dfb62566096cc8d5b5
2013-09-27 23:19:47 -07:00
Ori Livneh
ad429498c1 Update lessphp to upstream head (785ad53840)
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
2013-09-24 12:31:17 -07:00
Ori Livneh
b67b9e1b48 Support LESS stylesheets in ResourceLoader
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
2013-09-23 12:55:19 -07:00