mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Change extend format to :extend(.class); - part 1 - support for stand-alone &:extend(.class);
This commit is contained in:
17
dist/less-1.4.0.js
vendored
17
dist/less-1.4.0.js
vendored
@@ -654,9 +654,8 @@ less.Parser = function Parser(env) {
|
||||
primary: function () {
|
||||
var node, root = [];
|
||||
|
||||
while ((node = $(this.mixin.definition) || $(this.rule) || $(this.ruleset) ||
|
||||
$(this.mixin.call) || $(this.comment) || $(this.directive) ||
|
||||
$(this.extend))
|
||||
while ((node = $(this.extend) || $(this.mixin.definition) || $(this.rule) || $(this.ruleset) ||
|
||||
$(this.mixin.call) || $(this.comment) || $(this.directive))
|
||||
|| $(/^[\s\n]+/) || $(/^;+/)) {
|
||||
node && root.push(node);
|
||||
}
|
||||
@@ -942,15 +941,15 @@ less.Parser = function Parser(env) {
|
||||
extend: function() {
|
||||
var elements = [], e, args, index = i;
|
||||
|
||||
if (input.charAt(i) !== '+') { return; }
|
||||
if (!$(/^&:extend\(/)) { return; }
|
||||
|
||||
while (e = $(/^\+\+[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)) {
|
||||
elements.push(new(tree.Element)(null, e.slice(2), i));
|
||||
while (e = $(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)) {
|
||||
elements.push(new(tree.Element)(null, e, i));
|
||||
}
|
||||
|
||||
expect(/^\);/);
|
||||
|
||||
if (elements.length > 0 && ($(';') || peek('}'))) {
|
||||
return new(tree.Extend)(elements, index);
|
||||
}
|
||||
return new(tree.Extend)(elements, index);
|
||||
},
|
||||
|
||||
//
|
||||
|
||||
4
dist/less-1.4.0.min.js
vendored
4
dist/less-1.4.0.min.js
vendored
File diff suppressed because one or more lines are too long
17
dist/less-rhino-1.4.0.js
vendored
17
dist/less-rhino-1.4.0.js
vendored
@@ -646,9 +646,8 @@ less.Parser = function Parser(env) {
|
||||
primary: function () {
|
||||
var node, root = [];
|
||||
|
||||
while ((node = $(this.mixin.definition) || $(this.rule) || $(this.ruleset) ||
|
||||
$(this.mixin.call) || $(this.comment) || $(this.directive) ||
|
||||
$(this.extend))
|
||||
while ((node = $(this.extend) || $(this.mixin.definition) || $(this.rule) || $(this.ruleset) ||
|
||||
$(this.mixin.call) || $(this.comment) || $(this.directive))
|
||||
|| $(/^[\s\n]+/) || $(/^;+/)) {
|
||||
node && root.push(node);
|
||||
}
|
||||
@@ -934,15 +933,15 @@ less.Parser = function Parser(env) {
|
||||
extend: function() {
|
||||
var elements = [], e, args, index = i;
|
||||
|
||||
if (input.charAt(i) !== '+') { return; }
|
||||
if (!$(/^&:extend\(/)) { return; }
|
||||
|
||||
while (e = $(/^\+\+[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)) {
|
||||
elements.push(new(tree.Element)(null, e.slice(2), i));
|
||||
while (e = $(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)) {
|
||||
elements.push(new(tree.Element)(null, e, i));
|
||||
}
|
||||
|
||||
expect(/^\);/);
|
||||
|
||||
if (elements.length > 0 && ($(';') || peek('}'))) {
|
||||
return new(tree.Extend)(elements, index);
|
||||
}
|
||||
return new(tree.Extend)(elements, index);
|
||||
},
|
||||
|
||||
//
|
||||
|
||||
@@ -525,9 +525,8 @@ less.Parser = function Parser(env) {
|
||||
primary: function () {
|
||||
var node, root = [];
|
||||
|
||||
while ((node = $(this.mixin.definition) || $(this.rule) || $(this.ruleset) ||
|
||||
$(this.mixin.call) || $(this.comment) || $(this.directive) ||
|
||||
$(this.extend))
|
||||
while ((node = $(this.extend) || $(this.mixin.definition) || $(this.rule) || $(this.ruleset) ||
|
||||
$(this.mixin.call) || $(this.comment) || $(this.directive))
|
||||
|| $(/^[\s\n]+/) || $(/^;+/)) {
|
||||
node && root.push(node);
|
||||
}
|
||||
@@ -814,15 +813,15 @@ less.Parser = function Parser(env) {
|
||||
extend: function() {
|
||||
var elements = [], e, args, index = i;
|
||||
|
||||
if (input.charAt(i) !== '+') { return; }
|
||||
if (!$(/^&:extend\(/)) { return; }
|
||||
|
||||
while (e = $(/^\+\+[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)) {
|
||||
elements.push(new(tree.Element)(null, e.slice(2), i));
|
||||
while (e = $(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)) {
|
||||
elements.push(new(tree.Element)(null, e, i));
|
||||
}
|
||||
|
||||
expect(/^\);/);
|
||||
|
||||
if (elements.length > 0 && ($(';') || peek('}'))) {
|
||||
return new(tree.Extend)(elements, index);
|
||||
}
|
||||
return new(tree.Extend)(elements, index);
|
||||
},
|
||||
|
||||
//
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
}
|
||||
|
||||
.foo {
|
||||
++.clearfix;
|
||||
&:extend(.clearfix);
|
||||
color: red;
|
||||
}
|
||||
|
||||
.bar {
|
||||
++.clearfix;
|
||||
&:extend(.clearfix);
|
||||
color: blue;
|
||||
}
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
}
|
||||
|
||||
.sidebar2 {
|
||||
++.sidebar;
|
||||
&:extend(.sidebar);
|
||||
background: blue;
|
||||
}
|
||||
|
||||
.type1 {
|
||||
.sidebar3 {
|
||||
++.sidebar;
|
||||
&:extend(.sidebar);
|
||||
background: green;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
display: none;
|
||||
}
|
||||
.badError {
|
||||
++.error;
|
||||
&:extend(.error);
|
||||
border-width: 3px;
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
}
|
||||
|
||||
.ext1 .ext2 {
|
||||
++.foo;
|
||||
&:extend(.foo);
|
||||
}
|
||||
|
||||
.ext3,
|
||||
.ext4 {
|
||||
++.foo;
|
||||
&:extend(.foo);
|
||||
}
|
||||
|
||||
div.ext5,
|
||||
@@ -33,5 +33,5 @@ div.ext5,
|
||||
}
|
||||
|
||||
.ext7 {
|
||||
++.ext5;
|
||||
&:extend(.ext5);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user