From 62f7260af60d7445319a353141bc64a20e2b72ea Mon Sep 17 00:00:00 2001
From: Colan Schwartz <colan@58704.no-reply.drupal.org>
Date: Thu, 29 Aug 2019 14:51:59 -0400
Subject: [PATCH] Issue #3078107 by colan: Set field label variable and added
 to template.

---
 templates/horizontal-tabs.html.twig | 1 +
 templates/theme.inc                 | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/templates/horizontal-tabs.html.twig b/templates/horizontal-tabs.html.twig
index 9ed2a3a..ade81c0 100644
--- a/templates/horizontal-tabs.html.twig
+++ b/templates/horizontal-tabs.html.twig
@@ -12,4 +12,5 @@
  * @ingroup themeable
  */
 #}
+<div class="field__label">{{ title }}</div>
 <div data-horizontal-tabs-panes{{ attributes }}>{{ children }}</div>
diff --git a/templates/theme.inc b/templates/theme.inc
index 048c956..2245ee8 100644
--- a/templates/theme.inc
+++ b/templates/theme.inc
@@ -19,6 +19,11 @@ use Drupal\Core\Template\Attribute;
  */
 function template_preprocess_horizontal_tabs(array &$variables) {
   $element = $variables['element'];
+
+  if (!empty($element['#title'])) {
+    $variables['title'] = $element['#title'];
+  }
+
   $variables['children'] = (!empty($element['#children'])) ? $element['#children'] : '';
 }
 
-- 
2.7.4

