Make non strict units less strict and change the default to not be strict units. Fixes #1254

This commit is contained in:
agatronic
2013-04-26 19:17:00 +01:00
parent 1ba5e1edb6
commit 5bc4059c6b
7 changed files with 41 additions and 25 deletions

View File

@@ -1,8 +1,7 @@
@media (-o-min-device-pixel-ratio: 2/1) {
.test-maths-and-units {
font: ignores 0/0 rules;
mix-units: 2px;
invalid-units: 1px;
test-division: 7em;
simple: 2px;
}
}

View File

@@ -30,7 +30,7 @@
}
.units {
width: 1px;
z-index: 1;
same-unit-as-previously: 1px;
square-pixel-divided: 1px;
odd-unit: 2;
percentage: 500%;
@@ -39,5 +39,7 @@
conversion-metric-b: 3cm;
conversion-imperial: 3in;
custom-unit: 420octocats;
custom-unit-cancelling: 2;
custom-unit-cancelling: 18dogs;
mix-units: 2px;
invalid-units: 1px;
}

View File

@@ -25,7 +25,7 @@ sys.puts("\n" + stylize("LESS", 'underline') + "\n");
runTestSet({relativeUrls: true, silent: true});
runTestSet(null, "errors/", function(name, err, compiledLess, doReplacements) {
runTestSet({strictUnits: true}, "errors/", function(name, err, compiledLess, doReplacements) {
fs.readFile(path.join('test/less/', name) + '.txt', 'utf8', function (e, expectedErr) {
sys.print("- " + name + ": ");
expectedErr = doReplacements(expectedErr, 'test/less/errors/');
@@ -61,7 +61,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/");
runTestSet({strictMaths: false}, "legacy/");
function globalReplacements(input, directory) {
var p = path.join(process.cwd(), directory),

View File

@@ -1,8 +1,7 @@
@media (-o-min-device-pixel-ratio: 2/1) {
.test-maths-and-units {
font: ignores 0/0 rules;
mix-units: 1px + 1em;
invalid-units: 1px * 1px;
test-division: 4 / 2 + 5em;
simple: 1px + 1px;
}
}

View File

@@ -68,7 +68,7 @@
.units {
width: @onePixel;
z-index: (@onePixel / @onePixel);
same-unit-as-previously: (@onePixel / @onePixel);
square-pixel-divided: (@onePixel * @onePixel / @onePixel);
odd-unit: unit((@onePixel * 4em / 2cm));
percentage: (10 * 50%);
@@ -77,5 +77,7 @@
conversion-metric-b: (1cm + 20mm);
conversion-imperial: (1in + 72pt + 6pc);
custom-unit: (42octocats * 10);
custom-unit-cancelling: (8cats / 4cats);
custom-unit-cancelling: (8cats * 9dogs / 4cats);
mix-units: (1px + 1em);
invalid-units: (1px * 1px);
}