Page MenuHomePhabricator

Reduce copy-pasted <textarea> CSS to a maintainable subset
Open, Needs TriagePublic2 Estimated Story Points

Description

Our CSS currently contains this large block, probably copy-pasted from multiple web resources:

overflow-wrap: break-word;
-moz-appearance: textfield-multiline;
-webkit-user-select: text;
/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */
font: medium '-moz-fixed';
/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */
font: '-webkit-small-control';
font-size: medium;
line-height: normal;
color: initial;

The intended effect of this code is to make a <div> appear like a <textarea>, but without the border.

Following the same arguments @Volker_E gave in https://gerrit.wikimedia.org/r/433150 we find it critical to reduce this code to the smallest subset actually needed by our supported browsers. Code comments should explain which subset is required for which browser.

This came up (again) while working on T205431.

Patch-For-Review:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Lea_WMDE set the point value for this task to 5.Oct 16 2018, 2:03 PM

This needs to be tested on all the relevant browsers (at least ie, chrome, firefox, safari)

Change 470556 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/TwoColConflict@master] Remove CSS resets that don't have any effect

https://gerrit.wikimedia.org/r/470556

I guess the styles had their source in explanations like https://stackoverflow.com/questions/8956567/how-do-i-make-an-editable-div-look-like-a-text-field#comment63333399_8957518

A related question is, do you want that div to look like a normal browser textarea or like a Wikimedia MultilineTextInputWidget – for user-interface consistency I'd suggest latter.

Excellent point – I'm sure we will look into this again and fine-tune it later. At the moment it's a bit of both: We use the mw-editfont-monospace class as specified in mediawiki.editfont.less, but add the CSS shown above on top of it. The current goal is to make it look a bit like Flow in wikitext source editing mode.

Change 470556 merged by jenkins-bot:
[mediawiki/extensions/TwoColConflict@master] Remove CSS resets that don't have any effect

https://gerrit.wikimedia.org/r/470556

Change 760573 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/TwoColConflict@master] Remove unused user-select CSS property

https://gerrit.wikimedia.org/r/760573

Change 760573 merged by jenkins-bot:

[mediawiki/extensions/TwoColConflict@master] Remove unused user-select CSS property

https://gerrit.wikimedia.org/r/760573