Skip to content

Commit

Permalink
Merge pull request #506 from Harrison/master
Browse files Browse the repository at this point in the history
Issue #393 Add support for "rem" dimensions
  • Loading branch information
Alexis Sellier committed Dec 10, 2011
2 parents 431b202 + 6c3317f commit c47e5fa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/less/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,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|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/)) {
if (value = $(/^(-?\d*\.?\d+)(px|%|em|rem|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/)) {
return new(tree.Dimension)(value[1], value[2]);
}
},
Expand Down
3 changes: 3 additions & 0 deletions test/css/operations.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
.shorthands {
padding: -1px 2px 0 -4px;
}
.rem-dimensions {
font-size: 5.5rem;
}
.colors {
color: #123;
border-color: #334455;
Expand Down
4 changes: 4 additions & 0 deletions test/less/operations.less
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
padding: -1px 2px 0 -4px; //
}

.rem-dimensions {
font-size: 20rem / 5 + 1.5rem; // 5.5rem
}

.colors {
color: #123; // #112233
border-color: #234 + #111111; // #334455
Expand Down

0 comments on commit c47e5fa

Please sign in to comment.