Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
- 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.
  • Loading branch information
ljharb committed Oct 30, 2012
commit c45e8c35965b07d165210029b5495fe5f4e429f6
5 changes: 3 additions & 2 deletions lib/less/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a spacing issue here

return new(tree.Import)(path, imports, features, importOnce, index);
}
}

Expand Down