Skip to content
Snippets Groups Projects

Issue #3497594 by pdureau: Clean variant logic in templates

26 files
+ 44
44
Compare changes
  • Side-by-side
  • Inline
Files
26
{% if variant and variant|lower != 'default' %}
{% set variants = variant|split('__')|map(v => v|lower|replace({(v): 'fr-alert--' ~ v})|replace({_: '-'})) %}
{% if variant and variant != 'default' %}
{% set variants = variant|split('__')|map(v => v|replace({(v): 'fr-alert--' ~ v})) %}
{% set attributes = attributes.addClass(variants) %}
{% endif %}
Loading