Added CSS3 specific relative length units

See http://dev.w3.org/csswg/css3-values/#relative-length-units
This commit is contained in:
Evan Torrie
2011-08-08 15:12:23 -07:00
committed by Luke Page
parent 372569f726
commit 8284ce5fe0
2 changed files with 9 additions and 1 deletions

View File

@@ -685,7 +685,7 @@ less.Parser = function Parser(env) {
var value, c = input.charCodeAt(i);
if ((c > 57 || c < 45) || c === 47) return;
if (value = $(/^(-?\d*\.?\d+)(px|%|em|rem|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn|dpi)?/)) {
if (value = $(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn|dpi|rem|vw|vh|vm|ch)?/)) {
return new(tree.Dimension)(value[1], value[2]);
}
},

View File

@@ -66,3 +66,11 @@ p::before {
5.5% { border: 2px }
100% { border: 3px }
}
.units {
font: 1.2rem/2rem;
font: 8vw/9vw;
font: 10vh/12vh;
font: 12vm/15vm;
font: 1.2ch/1.5ch;
}