Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looping Custom Tags? #44

Closed
brandonreid opened this issue May 4, 2017 · 1 comment
Closed

Looping Custom Tags? #44

brandonreid opened this issue May 4, 2017 · 1 comment

Comments

@brandonreid
Copy link

brandonreid commented May 4, 2017

I'm able to make a custom tag easy enough following the documentation provided, but what I'd like to do when documenting colors, icons and other repeatable stuff, is create a custom tag that I can loop through in the template.

So ideally my styles file would look something like...

/**
* @section Color Palette
*
* @color {#F00} Brand Red ($brand-red) - Section Description
* @color {#F8F8F8} Foreground Shade ($fg-shade) - Used to shade foreground areas when needed.
**/

Then in a template I'd want to...

{{#each colors}}
  <p>{{color.name}}</p>
  etc...
{{/each}}

Is this possible?

Thanks in advance! Making my second pattern library with livingcss, such awesome stuff.

@straker
Copy link
Owner

straker commented May 5, 2017

Yep, multiple custom tags will be added as an array in the JSON context object. So it should be:

{{#each color}}
  <p>{{name}}</p>
{{/each}}

@straker straker closed this as completed in 7935fcf May 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants