Limit editor text area styles to where they are needed

Currently we load textarea styles across all pages. However, in practice
textareas only show up in the edit page and inside our JavaScript overlays

To avoid loading these styles as rendering blocking CSS

Additional changes:
* Drop css reset for textarea so that textareas where unstyled
have sensible defaults. Note given the usage of OOUI and MediaWiki UI
this should be minimal/no disruption.
* For consistency intentionally change the padding of the non-js editor
to be consistent with other textareas
* The padding-left/padding-right rules currently override the default rule
so consolidate them into one single rule

Note:
* This will not break non-JavaScript editor mode as the module
mediawiki.action.edit.styles is loaded on that page as a render blocking
style.

Bug: T199000
Depends-On: I1ab170fc4089b0c8129a3e62ee78efad1c6709fa
Change-Id: I91743fdf1942a1b1b750422e973bf98fc4d106db
This commit is contained in:
jdlrobson 2018-07-05 15:25:35 -07:00
parent ef63ced9b4
commit c7cb4ecee0
6 changed files with 19 additions and 10 deletions

View File

@ -2,6 +2,15 @@
@import 'minerva.variables.less';
@import 'mediawiki.mixins.animation.less';
.editor-textarea() {
// stylelint-disable-next-line no-descending-specificity
.box-sizing( border-box );
width: 100%;
// Note if a textarea has a .mw-ui-input class, this may be overridden
padding: 10px @contentPadding 10px @contentPadding;
resize: none;
}
// Generic mixin for applying styles to text that accompanies/adds context to workflows
.secondary-text() {
font-size: 0.9em;

View File

@ -12,7 +12,7 @@ small, strike, strong, sub, sup, tt,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
input, textarea, button, select,
input, button, select,
audio, video {
margin: 0;
padding: 0;

View File

@ -33,14 +33,6 @@
.box-sizing( border-box );
}
textarea {
padding: 5px 0 5px 5px;
width: 100%;
resize: none;
// stylelint-disable-next-line no-descending-specificity
.box-sizing( border-box );
}
// We hide the table of contents unless the user is viewing in tablet resolution or higher
.toc-mobile,
// Table of contents as provided by parser has no styling, this is a temporary measure until we are able

View File

@ -279,7 +279,6 @@ input.search {
.overlay .content-header,
.overlay .panel,
.page-list.side-list .list-thumb,
.editor-overlay .wikitext-editor,
.page-list li,
.topic-title-list li,
.site-link-list li,

View File

@ -2,6 +2,11 @@
@import '../../minerva.less/minerva.mixins';
.mw-editform {
textarea {
.editor-textarea();
}
.editHelp, .cancelLink {
display: none;
}

View File

@ -4,6 +4,10 @@
.overlay {
padding-top: @headerHeight;
textarea {
.editor-textarea();
}
> ul, button {
width: @headerHeight;
}