ability to parse more complex directives
This commit is contained in:
parent
3d60c12a68
commit
3f753da627
@ -378,12 +378,17 @@ less.parser = {
|
||||
}
|
||||
},
|
||||
directive: function directive(root) {
|
||||
var name, value, rules;
|
||||
var name, value, rules, types;
|
||||
|
||||
if (input[i] !== '@') return;
|
||||
|
||||
if (name = $(/@[a-z]+/g)) {
|
||||
if (name === '@media' || name === '@font-face') {
|
||||
if (name = $(/@media|@page/g)) {
|
||||
types = $(/[a-z:, ]+/g);
|
||||
if (rules = $(this.block, root)) {
|
||||
return new(node.Directive)(name + " " + types, rules);
|
||||
}
|
||||
} else if (name = $(/@[-a-z]+/g)) {
|
||||
if (name === '@font-face') {
|
||||
if (rules = $(this.block, root)) {
|
||||
return new(node.Directive)(name, rules);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user