diff --git a/modules/thunder_paragraphs/css/paragraphs.widget.css b/modules/thunder_paragraphs/css/paragraphs.widget.css index 4646388bc..6a4170f25 100644 --- a/modules/thunder_paragraphs/css/paragraphs.widget.css +++ b/modules/thunder_paragraphs/css/paragraphs.widget.css @@ -1,12 +1,12 @@ -/* Subform */ - -/* Hide paragraphs field label in table header. */ -.field--name-field-paragraphs .paragraphs-tabs-wrapper table.field-multiple-table:first-of-type th { +/* Set background in table header. */ +.field--widget-paragraphs .paragraphs-tabs-wrapper table.field-multiple-table:first-of-type th { background: var(--gin-bg-layer); } -.field--name-field-paragraphs .paragraphs-tabs-wrapper table.field-multiple-table:first-of-type thead th.field-label h4 { +/* Hide paragraphs field label in table header. */ +.field--widget-paragraphs table.field-multiple-table h4.paragraphs-table-header__label { display: none; } +/* Subform */ .paragraph-type--link .paragraphs-subform .field--name-field-link table.field-multiple-table:first-of-type thead { display: none; } diff --git a/modules/thunder_paragraphs/thunder_paragraphs.module b/modules/thunder_paragraphs/thunder_paragraphs.module index 269bdb884..3d0a58c3a 100644 --- a/modules/thunder_paragraphs/thunder_paragraphs.module +++ b/modules/thunder_paragraphs/thunder_paragraphs.module @@ -27,25 +27,18 @@ function thunder_paragraphs_field_widget_third_party_settings_form(WidgetInterfa } /** - * Implements hook_field_widget_single_element_WIDGET_TYPE_form_alter(). - * - * Used for Classic Paragraphs widget. + * Implements hook_preprocess_HOOK() for field_multiple_value_form. */ -function thunder_paragraphs_field_widgett_single_element_entity_reference_paragraphs_form_alter(array &$element, FormStateInterface $form_state, array $context): void { - thunder_paragraphs__attach_ief_submit( - $element, - [ - 'top', - 'links', - 'collapse_button', - ] - ); +function thunder_paragraphs_preprocess_field_multiple_value_form(array &$variables): void { + if (isset($variables['element']['#paragraphs_widget']) + && $variables['element']['#paragraphs_widget'] === TRUE + && isset($variables['table']['#header'][0]['data']['#attributes'])) { + $variables['table']['#header'][0]['data']['#attributes']->addClass('paragraphs-table-header__label'); + } } /** * Implements hook_field_widget_single_element_WIDGET_TYPE_form_alter(). - * - * Used for Experimental Paragraphs widget. */ function thunder_paragraphs_field_widget_single_element_paragraphs_form_alter(array &$element, FormStateInterface $form_state, array $context): void { // Based on logic in ParagraphsWidget::formMultipleElements - execution of