Skip to content

Instantly share code, notes, and snippets.

@arxpoetica
Created April 22, 2018 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arxpoetica/a5b6b2abd46fc6cc9f795c2d91e375a1 to your computer and use it in GitHub Desktop.
Save arxpoetica/a5b6b2abd46fc6cc9f795c2d91e375a1 to your computer and use it in GitHub Desktop.
Useful Pug mixins for Svelte
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