- Issue created by @yazzbe
Hi Mitsuko,
To target uikit image fields with css, you need the correct field names as a classes in the html markup. But the field wrapper does not provide field classses. The wrapper is just an empty
Is it possible to add the normal field classes like so:
eg. field--uikit-lightbox.html.twig
{%
set classes = [
'field',
'field--name-' ~ field_name|clean_class,
'field--type-' ~ field_type|clean_class,
'field--label-' ~ label_display,
label_display == 'inline' ? 'clearfix',
]
%}
{% set grid_classes = [
'uk-grid',
'uk-flex-center',
'uk-text-center'
]
%}
<div{{ attributes.addClass(classes, 'field__item') }}>
{% if label_hidden == false %}
<div{{ title_attributes.addClass('uk-hidden') }}>
{{ label }}
</div>
{% endif %}
<div{{ lightbox_attributes.setAttribute('data-uk-grid', 'masonry: true').addClass(grid_child_width_classes).addClass(grid_classes) }}>
{% for item in items %}
<div>
{{ item.content }}
</div>
{% endfor %}
</div>
</div>
Active
1.9
Code