+ {%- endfor -%}
+ {{ list_type }}>
+{%- endif %}
diff --git a/core/modules/system/templates/splitbutton.html.twig b/core/modules/system/templates/splitbutton.html.twig
index b074c137ab..2d116aa629 100644
--- a/core/modules/system/templates/splitbutton.html.twig
+++ b/core/modules/system/templates/splitbutton.html.twig
@@ -24,15 +24,16 @@
* @ingroup themeable
*/
#}
+{% set toggle_with_title = main_element is empty and title is not empty %}
- {{ main_element }}
- {% if splitbutton_multiple and exclude_toggle == FALSE %}
-
- {% endif %}
+ {{ main_element }}
+ {% if splitbutton_multiple and exclude_toggle == FALSE %}
+
+ {% endif %}
{{ splitbutton_item_list }}
diff --git a/core/modules/system/tests/modules/splitbutton_test/src/Element/SplitTextField.php b/core/modules/system/tests/modules/splitbutton_test/src/Element/SplitTextField.php
index ece6f9e153..bfa75a0068 100644
--- a/core/modules/system/tests/modules/splitbutton_test/src/Element/SplitTextField.php
+++ b/core/modules/system/tests/modules/splitbutton_test/src/Element/SplitTextField.php
@@ -90,7 +90,7 @@ public static function buildItemList(&$element, $items) {
'#theme' => 'item_list',
'#attributes' => [
'data-drupal-splitbutton-target' => $trigger_id,
- 'data-drupal-item-tags' => 'li',
+ 'data-drupal-splitbutton-item-tags' => 'li',
'aria-labelledby' => "$trigger_id-trigger",
'role' => 'listbox',
'id' => "$trigger_id-menu",
diff --git a/core/modules/system/tests/modules/splitbutton_test/src/Form/SplitButtonTestForm.php b/core/modules/system/tests/modules/splitbutton_test/src/Form/SplitButtonTestForm.php
index 3b03d651d1..1bb1210b88 100644
--- a/core/modules/system/tests/modules/splitbutton_test/src/Form/SplitButtonTestForm.php
+++ b/core/modules/system/tests/modules/splitbutton_test/src/Form/SplitButtonTestForm.php
@@ -274,6 +274,13 @@ public function buildForm(array $form, FormStateInterface $form_state, $disabled
'#required' => TRUE,
];
+ $form['hover_splitbutton'] = [
+ '#type' => 'splitbutton',
+ '#splitbutton_items' => $links_plus_button,
+ '#title' => $this->t('Splitbutton that opens on hover'),
+ '#hover' => TRUE,
+ ];
+
return $form;
}
diff --git a/core/profiles/demo_umami/themes/umami/templates/components/form/splitbutton.html.twig b/core/profiles/demo_umami/themes/umami/templates/components/form/splitbutton.html.twig
index c4c39e0239..bddee00fb9 100644
--- a/core/profiles/demo_umami/themes/umami/templates/components/form/splitbutton.html.twig
+++ b/core/profiles/demo_umami/themes/umami/templates/components/form/splitbutton.html.twig
@@ -61,14 +61,16 @@
})}) %}
{% endif %}
+{% set toggle_with_title = main_element is empty and title is not empty %}
+
- {{ main_element }}
- {% if splitbutton_multiple and exclude_toggle == FALSE %}
-
- {% endif %}
+ {{ main_element }}
+ {% if splitbutton_multiple and exclude_toggle == FALSE %}
+
+ {% endif %}
{{ splitbutton_item_list }}
diff --git a/core/themes/bartik/templates/splitbutton.html.twig b/core/themes/bartik/templates/splitbutton.html.twig
index c4c39e0239..bddee00fb9 100644
--- a/core/themes/bartik/templates/splitbutton.html.twig
+++ b/core/themes/bartik/templates/splitbutton.html.twig
@@ -61,14 +61,16 @@
})}) %}
{% endif %}
+{% set toggle_with_title = main_element is empty and title is not empty %}
+
- {{ main_element }}
- {% if splitbutton_multiple and exclude_toggle == FALSE %}
-
- {% endif %}
+ {{ main_element }}
+ {% if splitbutton_multiple and exclude_toggle == FALSE %}
+
+ {% endif %}
{{ splitbutton_item_list }}
diff --git a/core/themes/claro/css/components/splitbutton.css b/core/themes/claro/css/components/splitbutton.css
index a7dbd12fb5..12a82719bf 100644
--- a/core/themes/claro/css/components/splitbutton.css
+++ b/core/themes/claro/css/components/splitbutton.css
@@ -25,7 +25,7 @@
*/
/*
* Inputs.
- */ /* Absolute zero with opacity. */ /* Davy's grey with 0.6 opacity. */ /* Light gray with 0.3 opacity on white bg. */ /* Old silver with 0.5 opacity on white bg. */ /* (1/8)em ~ 2px */ /* (1/16)em ~ 1px */ /* Font size is too big to use 1rem for extrasmall line-height */ /* 7px inside the form element label. */ /* 8px with the checkbox width of 19px */
+ */ /* Absolute zero with opacity. */ /* Davy's gray with 0.6 opacity. */ /* Light gray with 0.3 opacity on white bg. */ /* Old silver with 0.5 opacity on white bg. */ /* (1/8)em ~ 2px */ /* (1/16)em ~ 1px */ /* Font size is too big to use 1rem for extrasmall line-height */ /* 7px inside the form element label. */ /* 8px with the checkbox width of 19px */
/*
* Details.
*/
@@ -131,10 +131,17 @@ html:not(.js) .splitbutton {
text-align: left;
text-decoration: none;
color: #545560;
- border-right: 1px solid #d4d4d8;
- border-left: 1px solid #d4d4d8;
+ /*
+ * Styling for borders require !important due to .button having border styles
+ * set to !important in button.pcss.css.
+ */
+ border-top: none !important;
+ border-right: 1px solid #d4d4d8 !important;
+ border-bottom: none !important;
+ border-left: 1px solid #d4d4d8 !important;
border-radius: 2px;
background: #fff;
+ box-shadow: none;
font-size: 1rem;
font-weight: normal;
line-height: 1rem;
@@ -143,10 +150,13 @@ html:not(.js) .splitbutton {
.js .splitbutton__operation-list-item:focus {
z-index: 5;
-}
-
-.js .splitbutton__operation-list-item:not(:focus) {
- box-shadow: none;
+ padding: calc(1rem - 4px) calc(1rem - 3px);
+ /*
+ * Styling for borders require !important due to .button having border styles
+ * set to !important in button.pcss.css.
+ */
+ border: 3px solid #26a769 !important;
+ outline: none;
}
.js .splitbutton__operation-list-item:hover {
diff --git a/core/themes/claro/css/components/splitbutton.pcss.css b/core/themes/claro/css/components/splitbutton.pcss.css
index fefa3cd51e..32899f4b3e 100644
--- a/core/themes/claro/css/components/splitbutton.pcss.css
+++ b/core/themes/claro/css/components/splitbutton.pcss.css
@@ -75,10 +75,17 @@ html:not(.js) .splitbutton {
text-align: left;
text-decoration: none;
color: #545560;
- border-right: 1px solid var(--color-lightgray);
- border-left: 1px solid var(--color-lightgray);
+ /*
+ * Styling for borders require !important due to .button having border styles
+ * set to !important in button.pcss.css.
+ */
+ border-top: none !important;
+ border-right: 1px solid var(--color-lightgray) !important;
+ border-bottom: none !important;
+ border-left: 1px solid var(--color-lightgray) !important;
border-radius: 2px;
background: #fff;
+ box-shadow: none;
font-size: 1rem;
font-weight: normal;
line-height: 1rem;
@@ -86,9 +93,13 @@ html:not(.js) .splitbutton {
}
.js .splitbutton__operation-list-item:focus {
z-index: 5;
-}
-.js .splitbutton__operation-list-item:not(:focus) {
- box-shadow: none;
+ padding: calc(1rem - 4px) calc(1rem - 3px);
+ /*
+ * Styling for borders require !important due to .button having border styles
+ * set to !important in button.pcss.css.
+ */
+ border: 3px solid var(--color-focus) !important;
+ outline: none;
}
.js .splitbutton__operation-list-item:hover {
color: #222330;
diff --git a/core/themes/claro/templates/form/splitbutton.html.twig b/core/themes/claro/templates/form/splitbutton.html.twig
index c4c39e0239..bddee00fb9 100644
--- a/core/themes/claro/templates/form/splitbutton.html.twig
+++ b/core/themes/claro/templates/form/splitbutton.html.twig
@@ -61,14 +61,16 @@
})}) %}
{% endif %}
+{% set toggle_with_title = main_element is empty and title is not empty %}
+
- {{ main_element }}
- {% if splitbutton_multiple and exclude_toggle == FALSE %}
-
- {% endif %}
+ {{ main_element }}
+ {% if splitbutton_multiple and exclude_toggle == FALSE %}
+
+ {% endif %}
{{ splitbutton_item_list }}
diff --git a/core/themes/seven/css/components/splitbutton.css b/core/themes/seven/css/components/splitbutton.css
index 06f3ff3f60..8c8f5283f3 100644
--- a/core/themes/seven/css/components/splitbutton.css
+++ b/core/themes/seven/css/components/splitbutton.css
@@ -102,7 +102,7 @@
text-decoration: none;
background: #aae0fe;
box-shadow: none;
- text-shadow: 0.25px 0 0.1px, -0.25px 0 0.1px;
+ text-shadow: 0.1px 0 0.1px, -0.1px 0 0.1px;
}
.js .splitbutton__operation-list li:first-child .splitbutton__operation-list-item {
diff --git a/core/themes/seven/templates/splitbutton.html.twig b/core/themes/seven/templates/splitbutton.html.twig
index c4c39e0239..bddee00fb9 100644
--- a/core/themes/seven/templates/splitbutton.html.twig
+++ b/core/themes/seven/templates/splitbutton.html.twig
@@ -61,14 +61,16 @@
})}) %}
{% endif %}
+{% set toggle_with_title = main_element is empty and title is not empty %}
+
- {{ main_element }}
- {% if splitbutton_multiple and exclude_toggle == FALSE %}
-
- {% endif %}
+ {{ main_element }}
+ {% if splitbutton_multiple and exclude_toggle == FALSE %}
+
+ {% endif %}
{{ splitbutton_item_list }}
diff --git a/core/themes/stable/templates/misc/splitbutton.html.twig b/core/themes/stable/templates/misc/splitbutton.html.twig
index 3b7dcbdab1..1b1bcc51bf 100644
--- a/core/themes/stable/templates/misc/splitbutton.html.twig
+++ b/core/themes/stable/templates/misc/splitbutton.html.twig
@@ -22,15 +22,16 @@
* @see template_preprocess_splitbutton()
*/
#}
+{% set toggle_with_title = main_element is empty and title is not empty %}
- {{ main_element }}
- {% if splitbutton_multiple and exclude_toggle == FALSE %}
-
- {% endif %}
+ {{ main_element }}
+ {% if splitbutton_multiple and exclude_toggle == FALSE %}
+
+ {% endif %}
{{ splitbutton_item_list }}
diff --git a/core/themes/stable9/templates/misc/splitbutton.html.twig b/core/themes/stable9/templates/misc/splitbutton.html.twig
index 3b7dcbdab1..1b1bcc51bf 100644
--- a/core/themes/stable9/templates/misc/splitbutton.html.twig
+++ b/core/themes/stable9/templates/misc/splitbutton.html.twig
@@ -22,15 +22,16 @@
* @see template_preprocess_splitbutton()
*/
#}
+{% set toggle_with_title = main_element is empty and title is not empty %}
- {{ main_element }}
- {% if splitbutton_multiple and exclude_toggle == FALSE %}
-
- {% endif %}
+ {{ main_element }}
+ {% if splitbutton_multiple and exclude_toggle == FALSE %}
+
+ {% endif %}