-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added basic support for mixin argument expansion - elipsis #288
- Loading branch information
meri
committed
Sep 24, 2015
1 parent
e2573c1
commit 095efc7
Showing
13 changed files
with
173 additions
and
81 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
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
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
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
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
28 changes: 28 additions & 0 deletions
28
src/test/resources/compile-basic-features/mixins/mixins-ellipsis.css
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
collapsed-list { | ||
one-parameter: 1 2 3; | ||
} | ||
expanded-list { | ||
three-parameters-1: 1; | ||
three-parameters-2: 2; | ||
three-parameters-3: 3; | ||
} | ||
expanded-comma-list { | ||
three-parameters-1: 1; | ||
three-parameters-2: 2; | ||
three-parameters-3: 3; | ||
} | ||
expanded-not-list { | ||
one-parameter: not-list; | ||
} | ||
pass-wrapper { | ||
one-parameter: 1 2 3; | ||
} | ||
.tail-loop-here { | ||
a: A; | ||
tail: b B c C; | ||
b: B; | ||
tail: c C; | ||
c: C; | ||
tail: ; | ||
the: end; | ||
} |
41 changes: 41 additions & 0 deletions
41
src/test/resources/compile-basic-features/mixins/mixins-ellipsis.less
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@list: 1 2 3; | ||
@comma-list: 1, 2, 3; | ||
@not-list: not-list; | ||
|
||
collapsed-list {.mixin(@list)} // 1 argument | ||
expanded-list {.mixin(@list...)} // 3 arguments | ||
expanded-comma-list {.mixin(@comma-list...)} // 3 arguments | ||
expanded-not-list {.mixin(@not-list...)} // 3 arguments | ||
pass-wrapper {.wrapper(@list)} // 1 argument | ||
|
||
|
||
.mixin(@a1) { | ||
one-parameter: @a1; | ||
} | ||
|
||
.mixin(@a1, @a2, @a3) { | ||
three-parameters-1: @a1; | ||
three-parameters-2: @a2; | ||
three-parameters-3: @a3; | ||
} | ||
|
||
.wrapper(@args...) { | ||
.mixin(@args...); // 1 argument of `c` expands as 3 arguments | ||
} | ||
|
||
// with tail | ||
.tail-loop() { the: end; } | ||
.tail-loop(@head, @tail...) { | ||
@first: extract(@head, 1); | ||
@second: extract(@head, 2); | ||
|
||
@{first}: @second; | ||
tail: @tail; | ||
.tail-loop(@tail...); | ||
} | ||
|
||
.tail-loop-here { | ||
@values : a A, b B, c C; | ||
.tail-loop(@values...); | ||
} | ||
|
Oops, something went wrong.