mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Merge pull request #2169 from SomMeri/comments-keyframe-rule
Accept comments in @keyframe and after rule name - merging for next patch release.
This commit is contained in:
@@ -1578,6 +1578,7 @@ less.Parser = function Parser(env) {
|
||||
value = this.detachedRuleset();
|
||||
}
|
||||
|
||||
this.comments();
|
||||
if (!value) {
|
||||
// prefer to try to parse first if its a variable or we are compressing
|
||||
// but always fallback on the other one
|
||||
@@ -1822,6 +1823,8 @@ less.Parser = function Parser(env) {
|
||||
break;
|
||||
}
|
||||
|
||||
this.comments();
|
||||
|
||||
if (hasIdentifier) {
|
||||
value = this.entity();
|
||||
if (!value) {
|
||||
@@ -1839,6 +1842,8 @@ less.Parser = function Parser(env) {
|
||||
}
|
||||
}
|
||||
|
||||
this.comments();
|
||||
|
||||
if (hasBlock) {
|
||||
rules = this.blockRuleset();
|
||||
}
|
||||
@@ -2053,9 +2058,20 @@ less.Parser = function Parser(env) {
|
||||
return name.push(a[1]);
|
||||
}
|
||||
}
|
||||
function cutOutBlockComments() {
|
||||
//match block comments
|
||||
var a = /^\s*\/\*(?:[^*]|\*+[^\/*])*\*+\//.exec(c);
|
||||
if (a) {
|
||||
length += a[0].length;
|
||||
c = c.slice(a[0].length);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
match(/^(\*?)/);
|
||||
while (match(/^((?:[\w-]+)|(?:@\{[\w-]+\}))/)); // !
|
||||
while (cutOutBlockComments());
|
||||
if ((name.length > 1) && match(/^\s*((?:\+_|\+)?)\s*:/)) {
|
||||
// at last, we have the complete match now. move forward,
|
||||
// convert name particles to tree objects and return:
|
||||
|
||||
@@ -58,6 +58,11 @@
|
||||
.sr-only-focusable {
|
||||
clip: auto;
|
||||
}
|
||||
@-webkit-keyframes hover {
|
||||
0% {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
#last {
|
||||
color: #0000ff;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
*/
|
||||
|
||||
.selector /* .with */, .lots, /* of */ .comments {
|
||||
color: grey, /* blue */ orange;
|
||||
color/* survive */ /* me too */: grey, /* blue */ orange;
|
||||
-webkit-border-radius: 2px /* webkit only */;
|
||||
-moz-border-radius: (2px * 4) /* moz only with operation */;
|
||||
}
|
||||
@@ -84,6 +84,12 @@
|
||||
clip: auto;
|
||||
}
|
||||
|
||||
@-webkit-keyframes /* Safari */ hover /* and Chrome */ {
|
||||
0% {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
#last { color: blue }
|
||||
//
|
||||
|
||||
|
||||
Reference in New Issue
Block a user