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

Issue #3495887 by grimreaper: Update field inline label classes to be like Core.

parent 97e24c2c
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
}, },
"suggest": { "suggest": {
"drupal/entity_vdts": "Allows to remove entity template wrappers.", "drupal/entity_vdts": "Allows to remove entity template wrappers.",
"drupal/fences": "Allows to control wrapping markup and classes of fields.",
"drupal/ui_examples": "Allows to have examples pages.", "drupal/ui_examples": "Allows to have examples pages.",
"drupal/ui_icons": "Allows to handle icons.", "drupal/ui_icons": "Allows to handle icons.",
"drupal/ui_skins": "Allows to switch between themes and to override CSS variables." "drupal/ui_skins": "Allows to switch between themes and to override CSS variables."
......
...@@ -39,23 +39,27 @@ ...@@ -39,23 +39,27 @@
*/ */
#} #}
{{ attach_library('ui_suite_bootstrap/field') }} {{ attach_library('ui_suite_bootstrap/field') }}
{% set classes = [
label_display == 'inline' ? 'clearfix',
] %}
{% set title_classes = [ {% set title_classes = [
'field--label', 'field--label',
'field--label--' ~ label_display|clean_class, 'field--label--' ~ label_display|clean_class,
label_display == 'visually_hidden' ? 'visually-hidden', label_display == 'visually_hidden' ? 'visually-hidden',
label_display == 'inline' ? 'float-start', label_display == 'inline' ? 'float-start',
label_display == 'inline' ? 'pe-2', label_display == 'inline' ? 'pe-2',
'fw-bold', 'fw-bold',
] %} ] %}
{% set field_items_wrapper_attributes = create_attribute(field_items_wrapper_attributes|default({})) %} {% set field_items_wrapper_attributes = create_attribute(field_items_wrapper_attributes|default({})) %}
{% set field_items_wrapper_classes = [ {% set field_items_wrapper_classes = [
'field--items', 'field--items',
multiple and label_display == 'inline' ? 'float-start', multiple and label_display == 'inline' ? 'float-start',
] %} ] %}
{%- if display_field_tag ~%} {%- if display_field_tag ~%}
<{{ field_tag|default('div') }}{{ attributes }}> <{{ field_tag|default('div') }}{{ attributes.addClass(classes) }}>
{%- endif -%} {%- endif -%}
{% if not label_hidden %} {% if not label_hidden %}
{% if display_label_tag -%} {% if display_label_tag -%}
......
...@@ -68,6 +68,7 @@ libraries-override: ...@@ -68,6 +68,7 @@ libraries-override:
system/base: system/base:
css: css:
component: component:
css/components/clearfix.module.css: false
css/components/container-inline.module.css: false css/components/container-inline.module.css: false
css/components/tablesort.module.css: false css/components/tablesort.module.css: false
text/drupal.text: ui_suite_bootstrap/drupal.text text/drupal.text: ui_suite_bootstrap/drupal.text
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment