aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/data/less/module
Commit message (Collapse)AuthorAgeFilesLines
* ResourceLoader: Fix regression of color mapping in Less.phpDerick Alangi2024-02-252-2/+2
| | | | | | | | | | | Less.php no longer requires mapping color names (https://github.com/wikimedia/less.php/blob/9bdb3fda0452a05769e51d9941f2cfc0871d5fc0/lib/Less/Colors.php#L9) to their respective hex values, see: I0e6fa0fa88b4ab8dc41c55524661 (T352866). If the color name is valid CSS, the color keyword (e.g. "green" is preseved by the less compiler). Change-Id: Ic91c9bb1d7b931f389cfaf3457d2fee845b9c3f0
* resourceloader: Add test case for ResourceLoader::getLessCompilerTimo Tijhof2018-05-192-1/+7
| | | | | | | | | | | | This was previously covered implicitly by an unrelated test. Change that test (dependency.less) to use ../ to access the file directly so that that test case is only about tracking dependencies and testing the parser. Then, add a second case that tests the use of import dirs. Bug: T140807 Change-Id: Ie85abffe313922c03b3e146422f36b1d6a79743d
* Fix another test broken by I826adf9Ori Livneh2015-09-181-1/+1
| | | | Change-Id: I15367691af8d2290d54cdb3bb134dfa71a15f9f7
* resourceloader: Fully remove ResourceLoaderLESSFunctionsOri Livneh2015-09-041-1/+0
| | | | | | | Deprecated in 1.24, for reasons explained in a0c41ae39d. I don't see any usage in core or extensions. Change-Id: I46f9e04ae633e7ff1ee112b652e1865731172f1f
* Make "/*@noflip*/ /*@embed*/" annotation work without CSSJanus hacksBartosz Dziewoński2014-09-231-0/+1
| | | | | | | | | | | | | | | | This reverts most of commit 2d842f14250646475b5c2ffa2fe4f5a131f94236, leaving only the test added in it, and reimplements the same functionality better. Instead of stripping /*@noflip*/ annotations in CSSJanus, which is incompatible with other implementations that preserve it, extend CSSMin to allow other CSS comments to be present before the rule-global @embed annotation. (This required making the regex logic in it even worse than it was, but it's actually slightly less terrible than I expected it would be. Good thing we have tests!) Bug: 69698 Change-Id: I58603ef64f7d7cdc6461b34721a4d6b15f15ad79
* Make "/*@noflip*/ /*@embed*/" annotation workBartosz Dziewoński2014-08-181-1/+0
| | | | | | | | | | | | | | | | To do it, just remove /*@noflip*/ annotations in CSSJanus after we're done processing. They are not needed anymore and some obscure interactions with CSSMin logic for preserving comments caused `/*@noflip*/ /*@embed*/ background-image: url(…)` not to work correctly (it would not be embedded). This also requires us to always do CSSJanus processing, even when we don't need flipping, to consistently handle the annotations. I'm not entirely sure if this is worth it, but I still greatly prefer doing it to documenting this stupid limitation. :) Bug: 69698 Change-Id: I311b12b08b2dff9d45efb584db08cf4a11318f59
* Support LESS stylesheets in ResourceLoaderOri Livneh2013-09-233-0/+15
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