forked from less/less.js
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mixins: don't duplicate rules with the same name (fixes less#49)
- this maintains the behavior where all mixins that matched the call are applied - if the result of applying the mixins produces rules with the same name then the last rule with that name wins - an alternative approach would be to only apply the last mixin that matches the call
- Loading branch information
1 parent
eb70b30
commit 1bee790
Showing
4 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
.a { | ||
mixed: 20; | ||
foo: 'bar'; | ||
mixed: 25; | ||
main: 'yes'; | ||
} | ||
.b { | ||
mixed: 20; | ||
foo: 'bar'; | ||
mixed: 25; | ||
main: 'yes'; | ||
} | ||
#main { | ||
foo: 'bar'; | ||
mixed: 25; | ||
main: 'yes'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.mixin() { | ||
mixed: 20; | ||
foo: 'bar'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
@import "import/mixins-import-a"; | ||
@import "import/mixins-import-b"; | ||
@import "import/mixins-import-b"; | ||
|
||
.mixin() { | ||
mixed: 25; | ||
main: 'yes'; | ||
} | ||
|
||
#main { | ||
.mixin | ||
} |