diff --git a/core/themes/olivero/css/components/form.css b/core/themes/olivero/css/components/form.css index 55e899b8..f274e7b4 100644 --- a/core/themes/olivero/css/components/form.css +++ b/core/themes/olivero/css/components/form.css @@ -233,14 +233,15 @@ tr .form-item, } /** - * Custom Css for views exposed filters. + * Inline forms. */ -.form--inline .form-item { - float: left; - margin-right: 0.5em; -} +.form--inline > * { + display: inline-block; + margin-top: 0.5625rem; + margin-bottom: 0; + } -.form--inline .form-actions { - clear: left; -} +.form--inline .form-item__label { + margin: 0; + } diff --git a/core/themes/olivero/css/components/form.pcss.css b/core/themes/olivero/css/components/form.pcss.css index c9023e00..b64b0769 100644 --- a/core/themes/olivero/css/components/form.pcss.css +++ b/core/themes/olivero/css/components/form.pcss.css @@ -178,13 +178,16 @@ tr .form-item, } /** - * Custom Css for views exposed filters. + * Inline forms. */ -.form--inline .form-item { - float: left; - margin-right: 0.5em; -} +.form--inline { + & > * { + display: inline-block; + margin-top: var(--sp0-5); + margin-bottom: 0; + } -.form--inline .form-actions { - clear: left; + & .form-item__label { + margin: 0; + } } diff --git a/core/themes/olivero/olivero.theme b/core/themes/olivero/olivero.theme index 5ab66a75..69c2ff27 100644 --- a/core/themes/olivero/olivero.theme +++ b/core/themes/olivero/olivero.theme @@ -630,3 +630,10 @@ function olivero_preprocess_table(&$variables) { } } } + +/** + * Implements hook_form_views_exposed_form_alter(). + */ +function olivero_form_views_exposed_form_alter(&$form) { + $form['#attributes']['class'][] = 'form--inline'; +} diff --git a/core/themes/olivero/templates/views/views-exposed-form.html.twig b/core/themes/olivero/templates/views/views-exposed-form.html.twig deleted file mode 100644 index 3c679ae5..00000000 --- a/core/themes/olivero/templates/views/views-exposed-form.html.twig +++ /dev/null @@ -1,21 +0,0 @@ -{# -/** - * @file - * Theme override for a views exposed form. - * - * Available variables: - * - form: A render element representing the form. - * - * @see template_preprocess_views_exposed_form() - */ -#} -{% if q is not empty %} - {# - This ensures that, if clean URLs are off, the 'q' is added first, - as a hidden form element, so that it shows up first in the POST URL. - #} -{{ q }} -{% endif %} -
- {{ form }} -