Skip to content

Instantly share code, notes, and snippets.

@lewisnyman
Last active November 27, 2017 17:39
Show Gist options
  • Save lewisnyman/96c3fdbcb5d0fcc1c2ae to your computer and use it in GitHub Desktop.
Save lewisnyman/96c3fdbcb5d0fcc1c2ae to your computer and use it in GitHub Desktop.
Patternab twig example patterns
<div class="box {{class}}">
<h2 class="box__title">{{title}}</h2>
<div class="box__content">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<div class="box__actions">
{% include "atoms-button" with
{
"element": "a",
"text": "Find out more",
"cta": true
}
%}
</div>
</div>
{% include "atoms-button"
with {
"element": "a",
"text": "Primary Button",
"styleModifier": "primary"
}
%}
{
"element": "a",
"text": "Button"
}
<{{element}} class="button{% if styleModifier %} button--{{styleModifier}}{% endif %}">
{{ text }}
</{{element}}
{
"element": "a",
"text": "Danger button",
"styleModifier": "danger"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment