Set 'is-color' variants based on in-content selection

This commit is contained in:
benjamin melançon 2018-10-24 05:25:30 -04:00
parent ee543ce2e6
commit ccd624460d

View file

@ -42,13 +42,15 @@
set classes = [ set classes = [
'hero', 'hero',
'hero-project', 'hero-project',
'is-cinnamon',
'paragraph', 'paragraph',
'paragraph--type--' ~ paragraph.bundle|clean_class, 'paragraph--type--' ~ paragraph.bundle|clean_class,
view_mode ? 'paragraph--view-mode--' ~ view_mode|clean_class, view_mode ? 'paragraph--view-mode--' ~ view_mode|clean_class,
not paragraph.isPublished() ? 'paragraph--unpublished' not paragraph.isPublished() ? 'paragraph--unpublished'
] ]
%} %}
{% if content.field_style_color %}
{% set classes = classes|merge(['is-'~content.field_style_color|render|trim]) %}
{% endif %}
{% block paragraph %} {% block paragraph %}
<section{{ attributes.addClass(classes) }}> <section{{ attributes.addClass(classes) }}>
{% block content %} {% block content %}