Created
April 22, 2018 09:38
-
-
Save arxpoetica/a5b6b2abd46fc6cc9f795c2d91e375a1 to your computer and use it in GitHub Desktop.
Useful Pug mixins for Svelte
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
mixin head | |
svelte:head | |
block | |
mixin title(expression) | |
+head | |
title!= expression | |
mixin if(expression) | |
!= '{#if ' + expression + '}' | |
block | |
!= '{/if}' | |
mixin each(expression) | |
!= '{#each ' + expression + '}' | |
block | |
!= '{/each}' | |
//- NOTE THESE EXPRESSIONS MUST GO TOGETHER! | |
mixin ifstart(expression) | |
!= '{#if ' + expression + '}' | |
block | |
mixin elseif(expression) | |
!= '{:elseif ' + expression + '}' | |
block | |
mixin else() | |
!= '{:else}' | |
block | |
mixin ifend() | |
!= '{/if}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment