From c45e8c35965b07d165210029b5495fe5f4e429f6 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 30 Oct 2012 10:15:01 -0700 Subject: [PATCH 1/2] - Change the default behavior of "@import" to only import once. - Add @import-multiple if for some insane reason you want multiple imports. - Continue to support @import-once for backwards compatibility. - Fixes #212. --- lib/less/parser.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/less/parser.js b/lib/less/parser.js index 9299c74e4..f3fae2dff 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -1173,12 +1173,13 @@ less.Parser = function Parser(env) { save(); - var dir = $(/^@import(?:-(once))?\s+/); + var dir = $(/^@import(?:-(once|multiple))?\s+/); if (dir && (path = $(this.entities.quoted) || $(this.entities.url))) { features = $(this.mediaFeatures); if ($(';')) { - return new(tree.Import)(path, imports, features, (dir[1] === 'once'), index); + var importOnce = dir[1] !== 'multiple'; + return new(tree.Import)(path, imports, features, importOnce, index); } } From a0e4c31c138cf746e76cc824118df256edba9eed Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 30 Oct 2012 11:12:27 -0700 Subject: [PATCH 2/2] Oops, s/tabs/spaces --- lib/less/parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/less/parser.js b/lib/less/parser.js index f3fae2dff..fddb3b5ee 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -1178,7 +1178,7 @@ less.Parser = function Parser(env) { if (dir && (path = $(this.entities.quoted) || $(this.entities.url))) { features = $(this.mediaFeatures); if ($(';')) { - var importOnce = dir[1] !== 'multiple'; + var importOnce = dir[1] !== 'multiple'; return new(tree.Import)(path, imports, features, importOnce, index); } }