Last active
April 20, 2018 18:04
-
-
Save BananaAcid/d80fb9dde601b5d786e54376769727a2 to your computer and use it in GitHub Desktop.
PUG (Jade) Mixins
This file contains hidden or 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
//- | |
PhpStorm 2018.1 shows multiple errors and is not able to handle this fully valid PUG mixin | |
mixin test(param1, param2 = "test", optionalParam3) | |
- var xOptionalParam3 = optionalParam3 || "is none"; | |
<!{param1}> !{param2} => !{xOptionalParam3} </!{param1}> | |
This file contains hidden or 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
//- | |
Nested use of mixins with params and content block! | |
//- | |
<div><span>a</span>:<em>some content</em></div> | |
mixin test(val) | |
div | |
span= val | |
| : | |
em | |
block | |
+test("a") | |
| some content | |
//- | |
<ol> | |
<li>EMPTY! (abc)</li> | |
<li>default item (def)</li> | |
<li>new... (ghi)</li> | |
</ol> | |
mixin ArrayList() | |
ol | |
| #[block] | |
mixin ArrayListItemPlaceholder() | |
li EMPTY! (#[block]) | |
mixin ArrayListItem() | |
li default item (#[block]) | |
mixin ArrayListItemNew() | |
li new... (#[block]) | |
+ArrayList() | |
+ArrayListItemPlaceholder() | |
| abc | |
+ArrayListItem() | |
| def | |
+ArrayListItemNew() | |
| ghi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment