mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Add strictUnits option, add tests for legacy behaviour
This commit is contained in:
5
test/css/legacy/legacy.css
Normal file
5
test/css/legacy/legacy.css
Normal file
@@ -0,0 +1,5 @@
|
||||
.test-maths-and-units {
|
||||
mix-units: 2px;
|
||||
invalid-units: 1px;
|
||||
test-division: 7em;
|
||||
}
|
||||
@@ -31,13 +31,13 @@
|
||||
.units {
|
||||
width: 1px;
|
||||
z-index: 1;
|
||||
square-pixel: 1px;
|
||||
odd-unit: 2em;
|
||||
square-pixel-divided: 1px;
|
||||
odd-unit: 2;
|
||||
percentage: 500%;
|
||||
pixels: 500px;
|
||||
conversion-metric-a: 30mm;
|
||||
conversion-metric-b: 3cm;
|
||||
conversion-imperial: 3in;
|
||||
custom-unit: 420cheeseburgers;
|
||||
custom-unit: 420octocats;
|
||||
custom-unit-cancelling: 2;
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ runTestSet({dumpLineNumbers: 'all'}, "debug/", null,
|
||||
function(name) { return name + '-all'; });
|
||||
runTestSet({relativeUrls: false, rootpath: "folder (1)/"}, "static-urls/");
|
||||
runTestSet({compress: true}, "compression/");
|
||||
runTestSet({strictUnits: false, strictMaths: false}, "legacy/");
|
||||
|
||||
function globalReplacements(input, directory) {
|
||||
var p = path.join(process.cwd(), directory),
|
||||
|
||||
5
test/less/legacy/legacy.less
Normal file
5
test/less/legacy/legacy.less
Normal file
@@ -0,0 +1,5 @@
|
||||
.test-maths-and-units {
|
||||
mix-units: 1px + 1em;
|
||||
invalid-units: 1px * 1px;
|
||||
test-division: 4 / 2 + 5em;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ body {
|
||||
.slash-vs-math {
|
||||
.border-radius();
|
||||
.border-radius(5px/10px);
|
||||
.border-radius((3px * 2px));
|
||||
.border-radius((3px * 2));
|
||||
}
|
||||
// semi-colon vs comma for delimiting
|
||||
|
||||
|
||||
@@ -69,13 +69,13 @@
|
||||
.units {
|
||||
width: @onePixel;
|
||||
z-index: (@onePixel / @onePixel);
|
||||
square-pixel: (@onePixel * @onePixel * @onePixel / @onePixel);
|
||||
odd-unit: (@onePixel * 4em / 2cm);
|
||||
square-pixel-divided: (@onePixel * @onePixel / @onePixel);
|
||||
odd-unit: unit((@onePixel * 4em / 2cm));
|
||||
percentage: (10 * 50%);
|
||||
pixels: (50px * 10);
|
||||
conversion-metric-a: (20mm + 1cm);
|
||||
conversion-metric-b: (1cm + 20mm);
|
||||
conversion-imperial: (1in + 72pt + 6pc);
|
||||
custom-unit: (42octocats * 10cheeseburgers);
|
||||
custom-unit: (42octocats * 10);
|
||||
custom-unit-cancelling: (8cats / 4cats);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user