Skip to content

Instantly share code, notes, and snippets.

@Christo44
Created September 7, 2016 15:17
Show Gist options
  • Save Christo44/1edc7adaed9d1a5b66b1c4c44705470d to your computer and use it in GitHub Desktop.
Save Christo44/1edc7adaed9d1a5b66b1c4c44705470d to your computer and use it in GitHub Desktop.
Create list if specific values are present, & omit empty values
-var books= {"books": [""]}
mixin component(name, books)
for book in books
case book
when "l"
-var p= "large"
when "m"
-var p= "medium"
when "s"
-var p= "small"
default
-var p= "large"
div(class= book)
p= p
+component("name", ["l", "m"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment