mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Added CSS3 specific relative length units
See http://dev.w3.org/csswg/css3-values/#relative-length-units
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user