<div class="variant theme-default">
Some Text<br><br>
<img src="https://images.fastspot.com/framework/300x200/1" /><br><br>
<em>I'm in my own file because lots of markup changed. Look, an image above!</em><br><br>
<em>You'll also notice I inherited the default context, since I did supply any in my variant.
</div>
<div class="variant theme-{{ theme }}">
{{ text }}<br><br>
<img src="https://images.fastspot.com/framework/300x200/{{ image }}" /><br><br>
<em>I'm in my own file because lots of markup changed. Look, an image above!</em><br><br>
<em>You'll also notice I inherited the default context, since I did supply any in my variant.
</div>
Variants allow you to create different context for the same component.
variants
array in the components respective [component].config.js
[component]--variant-name.twig
accordion--alt.twig
- The Accordion component with a variant called “Alt”This option should be used when the underlying markup does not change. Example scenarious would be:
video
variant vs the image
variant in a page header
This option should only be used when underlying markup will change significantly. Example scenarious would be:
See examples/variants/variants.config.js