mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
Correct handling of units.
width: 1cm - 5mm => width: 0.5cm (instead of -4cm) @ratio: 100px/50px => @ratio == 2 (instead of 2px)
This commit is contained in:
committed by
Luke Page
parent
2f5b0a6a0a
commit
c98495a100
@@ -3,7 +3,7 @@
|
||||
border: (@var * 2) solid black;
|
||||
margin: (@var * 1) (@var + 2) (4 * 4) 3;
|
||||
width: (6 * 6);
|
||||
padding: 2px (6px * 6px);
|
||||
padding: 2px (6 * 6px);
|
||||
}
|
||||
|
||||
.more-parens {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
@quotes: "~" "~";
|
||||
@q: @quotes;
|
||||
@onePixel: 1px;
|
||||
|
||||
.variables {
|
||||
height: @b + @x + 0px; // 24px
|
||||
@@ -49,12 +50,12 @@
|
||||
@name: 'var';
|
||||
name: @@name;
|
||||
}
|
||||
|
||||
.alpha {
|
||||
@var: 42;
|
||||
filter: alpha(opacity=@var);
|
||||
}
|
||||
|
||||
}
|
||||
// test current behaviour
|
||||
.polluteMixin() {
|
||||
@a: 'pollution';
|
||||
@@ -62,4 +63,17 @@
|
||||
.testPollution {
|
||||
a: @a;
|
||||
.polluteMixin();
|
||||
a: @a;
|
||||
a: @a;
|
||||
}
|
||||
|
||||
.units {
|
||||
width: @onePixel;
|
||||
z-index: @onePixel / @onePixel;
|
||||
square-pixel: @onePixel * @onePixel * @onePixel / @onePixel;
|
||||
odd-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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user