From 441e12f2d9c8a51935ae735ed51c48ed4e80bcc0 Mon Sep 17 00:00:00 2001 From: Volker E Date: Thu, 19 Sep 2019 13:36:48 -0700 Subject: [PATCH] Messages collected above the form are meant to live as boxed messages Also removing HTMLForm/VForm `.error` and `.warning` classes from 'forms.less'. Bug: T233362 Change-Id: I4f8d8f228ab07253a7df24470791c26e39bc311a --- includes/htmlform/HTMLForm.php | 2 +- .../src/mediawiki.ui/components/forms.less | 29 ++++--------------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php index 04be6c4e60..58c16021fc 100644 --- a/includes/htmlform/HTMLForm.php +++ b/includes/htmlform/HTMLForm.php @@ -1329,7 +1329,7 @@ class HTMLForm extends ContextSource { } return $elementstr - ? Html::rawElement( 'div', [ 'class' => $elementsType ], $elementstr ) + ? Html::rawElement( 'div', [ 'class' => $elementsType . 'box' ], $elementstr ) : ''; } diff --git a/resources/src/mediawiki.ui/components/forms.less b/resources/src/mediawiki.ui/components/forms.less index 01318c936d..1d364ce04e 100644 --- a/resources/src/mediawiki.ui/components/forms.less +++ b/resources/src/mediawiki.ui/components/forms.less @@ -84,13 +84,11 @@ // // Markup: //
- //
An error occurred
+ //
+ //
  • An error occurred. There are problems with some of your input.
+ //
//
A warning to be noted
//
Action successful!
- //
A different kind of error
- //
- //
  • There are problems with some of your input.
- //
//
// //
@@ -107,8 +105,6 @@ //
// // Styleguide 5.2. - .error, - .warning, .errorbox, .warningbox, .successbox { @@ -119,27 +115,12 @@ word-wrap: break-word; } - // Colours taken from those for .errorbox in shared.css - .error { - background-color: @backgroundColorError; - color: @colorTextEmphasized; - border: 1px solid @borderColorError; - } - - // Colours taken from those for .warningbox in shared.css - .warning { - background-color: @backgroundColorWarning; - color: @colorTextEmphasized; - border: 1px solid @borderColorWarning; - } - // This specifies styling for individual field validation error messages. // Show them below the fields to prevent line break glitches, and leave // some space between the field and the error message box. .mw-ui-vform-field { - .error, - .warning { - display: block; + .errorbox, + .warningbox { margin-top: 5px; } } -- 2.20.1