Problem/Motivation
In field component, 'field__item' class is hardcoded
Proposed resolution
In field.twig, add
{%
set field_item_classes = [
'field__item',
]|merge(field_item_utility_classes ?: [])
%}and change the 2 lines with
<div {{ item.attributes.addClass('field__item') }}>{{ item.content }}</div>
to
<div {{ item.attributes.addClass(field_item_classes) }}>{{ item.content }}</div>
We can then use the component like this
{%
include "radix:field" with {
field_item_utility_classes: ['ratio', 'ratio-16x9'],
}
%}Remaining tasks
1. update field.twig
2. update field.component.yml
3. update documentation
MR is coming ;-)
Issue fork radix-3504338
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
philyComment #6
doxigo commentedLovely, thanks Philippe, merged