add support for @keyframes blocks

This commit is contained in:
Ian Beck
2011-03-10 11:26:19 -08:00
committed by cloudhead
parent 04c2176bdb
commit f38e644008

View File

@@ -787,7 +787,7 @@ less.Parser = function Parser(env) {
var e, t, c;
c = $(this.combinator);
e = $(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/) || $('*') || $(this.attribute) || $(/^\([^)@]+\)/);
e = $(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/) || $('*') || $(this.attribute) || $(/^\([^)@]+\)/) || $(/^(?:\d*\.)?\d+%/);
if (e) { return new(tree.Element)(c, e) }
@@ -889,7 +889,7 @@ less.Parser = function Parser(env) {
var selectors = [], s, rules, match;
save();
if (match = /^([.#: \w-]+)[\s\n]*\{/.exec(chunks[j])) {
if (match = /^([.#:% \w-]+)[\s\n]*\{/.exec(chunks[j])) {
i += match[0].length - 1;
selectors = [new(tree.Selector)([new(tree.Element)(null, match[1])])];
} else {
@@ -966,7 +966,7 @@ less.Parser = function Parser(env) {
if (value = $(this['import'])) {
return value;
} else if (name = $(/^@media|@page|@-[-a-z]+/)) {
} else if (name = $(/^@media|@page/) || $(/^@(?:-webkit-)?keyframes/)) {
types = ($(/^[^{]+/) || '').trim();
if (rules = $(this.block)) {
return new(tree.Directive)(name + " " + types, rules);