diff --git a/core/includes/form.inc b/core/includes/form.inc
index 87f8edf..ceafbbf 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -812,7 +812,9 @@ function form_process_select($element) {
}
/**
- * Returns HTML for a select form element.
+ * Preprocesses variables for theme_select().
+ *
+ * Default template: select.html.twig
*
* It is possible to group options together; to do this, change the format of
* $options to an associative array in which the keys are group labels, and the
@@ -823,15 +825,14 @@ function form_process_select($element) {
* - element: An associative array containing the properties of the element.
* Properties used: #title, #value, #options, #description, #extra,
* #multiple, #required, #name, #attributes, #size.
- *
- * @ingroup themeable
*/
-function theme_select($variables) {
+function template_preprocess_select(&$variables) {
$element = $variables['element'];
element_set_attributes($element, array('id', 'name', 'size'));
_form_set_attributes($element, array('form-select'));
- return '';
+ $variables['attributes'] = $element['#attributes'];
+ $variables['options'] = form_select_options($element);
}
/**
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index dd50e62..072e213 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -2664,6 +2664,7 @@ function drupal_common_theme() {
),
'select' => array(
'render element' => 'element',
+ 'template' => 'select',
),
'fieldset' => array(
'render element' => 'element',
diff --git a/core/modules/system/templates/select.html.twig b/core/modules/system/templates/select.html.twig
new file mode 100644
index 0000000..fe7451a
--- /dev/null
+++ b/core/modules/system/templates/select.html.twig
@@ -0,0 +1,15 @@
+{#
+/**
+ * @file
+ * Default theme implementation for a select element.
+ *
+ * Available variables
+ * - attributes: HTML attributes for the select tag.
+ * - options: HTML string of options.
+ *
+ * @see template_preprocess_select()
+ *
+ * @ingroup themeable
+ */
+#}
+