Skip to content

Instantly share code, notes, and snippets.

@KatieMFritz
Last active September 27, 2017 19:05
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 KatieMFritz/3195810f047f199bb8e320c26bdf3c5b to your computer and use it in GitHub Desktop.
Save KatieMFritz/3195810f047f199bb8e320c26bdf3c5b to your computer and use it in GitHub Desktop.
Color swatches from YAML array for Pattern Lab Node edition
<ul class="sg-colors">
{{#colors}}
<li>
<span class="sg-swatch" style="background: {{ hex-code }}"></span>
<span class="sg-label">{{ color-name }}</span><br>
<span class="sg-label">{{ hex-code }}</span>
</li>
{{/colors}}
</ul>
colors:
- color-name: $color-primary
hex-code: '#1997a9'
- color-name: $color-secondary
hex-code: '#439539'
- color-name: $color-accent
hex-code: '#f89728'
- color-name: $color-text
hex-code: '#6d6e71'
- color-name: $color-gray-light
hex-code: 'hsl(225, 4%, 95%)'
- color-name: $color-black
hex-code: '#000'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment