Skip to content
Snippets Groups Projects
Commit cc8278db authored by Florent Torregrosa's avatar Florent Torregrosa Committed by Florent Torregrosa
Browse files

Issue #3359437 by mademo, Grimreaper, pdureau: Field display: respect label inline or above

parent 6ba986f4
Branches
Tags
1 merge request!119Issue #3359437: Field display: respect label inline or above
.field--label--inline::after {
content: ":";
}
......@@ -38,18 +38,30 @@
* @ingroup themeable
*/
#}
{{ attach_library('ui_suite_bootstrap/field') }}
{%
set title_classes = [
'field--label',
'field--label--' ~ label_display|clean_class,
label_display == 'visually_hidden' ? 'visually-hidden',
label_display == 'inline' ? 'float-start',
label_display == 'inline' ? 'pe-2',
'fw-bold',
]
%}
<div{{ attributes.addClass(classes) }}>
{% set field_items_attributes = create_attribute({
'class': [
'field--items',
multiple and label_display == 'inline' ? 'float-start',
]
}) %}
<div{{ attributes }}>
{% if not label_hidden %}
<div{{ title_attributes.addClass(title_classes) }}>{{ label }}</div>
{% endif %}
<div class="field__items">
<div{{ field_items_attributes }}>
{% for item in items %}
<div{{ item.attributes.addClass('field__item') }}>{{ item.content }}</div>
<div{{ item.attributes.addClass('field--item') }}>{{ item.content }}</div>
{% endfor %}
</div>
</div>
......@@ -45,6 +45,11 @@ example_carousel:
theme:
assets/css/example/carousel.css: {}
field:
css:
component:
assets/css/component/field.css: {}
form:
css:
component:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment