From 6004cbfaea6b1dee800a5c4c93e78c2614fc7c4a Mon Sep 17 00:00:00 2001 From: Volker E Date: Fri, 6 Oct 2017 15:06:45 -0700 Subject: [PATCH] HTMLForm: Rename file to `ooui.styles.less` and use LESS notation Turning ooui.styles into a LESS files and take advantage of LESS notation. This is in preparation for mangling whitespace of OOUI Special:Pages forms. Bug: T177668 Change-Id: Icd955358dbbf50712d8a66a0325aa14c8e7963d2 --- resources/Resources.php | 2 +- .../src/mediawiki/htmlform/ooui.styles.css | 47 ------------------ .../src/mediawiki/htmlform/ooui.styles.less | 49 +++++++++++++++++++ 3 files changed, 50 insertions(+), 48 deletions(-) delete mode 100644 resources/src/mediawiki/htmlform/ooui.styles.css create mode 100644 resources/src/mediawiki/htmlform/ooui.styles.less diff --git a/resources/Resources.php b/resources/Resources.php index b31926b79f..6d59d5ce6d 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -1110,7 +1110,7 @@ return [ 'targets' => [ 'desktop', 'mobile' ], ], 'mediawiki.htmlform.ooui.styles' => [ - 'styles' => 'resources/src/mediawiki/htmlform/ooui.styles.css', + 'styles' => 'resources/src/mediawiki/htmlform/ooui.styles.less', 'targets' => [ 'desktop', 'mobile' ], ], 'mediawiki.icon' => [ diff --git a/resources/src/mediawiki/htmlform/ooui.styles.css b/resources/src/mediawiki/htmlform/ooui.styles.css deleted file mode 100644 index dbf2b6b461..0000000000 --- a/resources/src/mediawiki/htmlform/ooui.styles.css +++ /dev/null @@ -1,47 +0,0 @@ -/* OOUIHTMLForm styles */ - -.mw-htmlform-ooui .mw-htmlform-field-HTMLCheckMatrix { - width: 100%; -} - -.mw-htmlform-ooui .mw-htmlform-matrix { - border-spacing: 0; -} - -.mw-htmlform-ooui .mw-htmlform-matrix td { - padding: 0.35em 0.7em; - -webkit-transition: background-color 250ms; - -moz-transition: background-color 250ms; - transition: background-color 250ms; -} - -.mw-htmlform-ooui .mw-htmlform-matrix tbody tr:nth-child( even ) td { - background-color: #f8f9fa; -} - -.mw-htmlform-ooui .mw-htmlform-matrix tbody tr:not( :first-child ):hover td { - background-color: #eaecf0; -} - -.mw-htmlform-ooui .mw-htmlform-matrix tbody tr:first-child td { - background-color: #fff; -} - -.mw-htmlform-ooui .mw-htmlform-matrix td.first { - margin-right: 5%; - width: 39%; -} - -/* Flatlist styling for PHP widgets... */ -.mw-htmlform-flatlist .oo-ui-fieldLayout-align-inline, -/* ...and for JS widgets */ -.mw-htmlform-flatlist .oo-ui-radioOptionWidget, -.mw-htmlform-flatlist .oo-ui-checkboxMultioptionWidget { - display: inline-block; - margin-right: 1em; -} - -.mw-htmlform-ooui .htmlform-tip, -.mw-htmlform-ooui .mw-htmlform-submit-buttons { - margin-top: 1em; -} diff --git a/resources/src/mediawiki/htmlform/ooui.styles.less b/resources/src/mediawiki/htmlform/ooui.styles.less new file mode 100644 index 0000000000..43acb3ab3a --- /dev/null +++ b/resources/src/mediawiki/htmlform/ooui.styles.less @@ -0,0 +1,49 @@ +/* OOUIHTMLForm styles */ + +.mw-htmlform-ooui { + .mw-htmlform-field-HTMLCheckMatrix { + width: 100%; + } + + .mw-htmlform-matrix { + border-spacing: 0; + + td { + padding: 0.35em 0.7em; + -webkit-transition: background-color 250ms; + -moz-transition: background-color 250ms; + transition: background-color 250ms; + } + + tbody tr:nth-child( even ) td { + background-color: #f8f9fa; + } + + tbody tr:not( :first-child ):hover td { + background-color: #eaecf0; + } + + tbody tr:first-child td { + background-color: #fff; + } + + td.first { + margin-right: 5%; + width: 39%; + } + } +} + +/* Flatlist styling for PHP widgets... */ +.mw-htmlform-flatlist .oo-ui-fieldLayout-align-inline, +/* ...and for JS widgets */ +.mw-htmlform-flatlist .oo-ui-radioOptionWidget, +.mw-htmlform-flatlist .oo-ui-checkboxMultioptionWidget { + display: inline-block; + margin-right: 1em; +} + +.mw-htmlform-ooui .htmlform-tip, +.mw-htmlform-ooui .mw-htmlform-submit-buttons { + margin-top: 1em; +} -- 2.20.1