jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/389772 )

Change subject: Change stylesheet files to Less
......................................................................


Change stylesheet files to Less

For now, we mostly utilize the ability to import colors instead of
hard-coding their hex values, but there are probably further
improvements down the line.

Some colors that SpecialConstraintReportPage.less uses are not part of
mediawiki.ui/variables, and it’s not clear how to import the stylesheet
that does define them, so for now those remain hard-coded.

Change-Id: I5d53b985ddbfce5f3964fc5d5e32a8c1527a6596
---
M Gruntfile.js
M extension.json
R modules/SpecialConstraintReportPage.less
D modules/gadget.css
A modules/gadget.less
R modules/ui/ConstraintReportGroup.less
D modules/ui/ConstraintReportPanel.css
A modules/ui/ConstraintReportPanel.less
8 files changed, 39 insertions(+), 32 deletions(-)

Approvals:
  WMDE-leszek: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Gruntfile.js b/Gruntfile.js
index a46421f..6f3bec9 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -27,6 +27,7 @@
                stylelint: {
                        all: [
                                '**/*.css',
+                               '**/*.less',
                                '!node_modules/**',
                                '!vendor/**'
                        ]
diff --git a/extension.json b/extension.json
index 1c4b6f1..bf7f0e8 100644
--- a/extension.json
+++ b/extension.json
@@ -46,7 +46,7 @@
        },
        "ResourceModules": {
                "SpecialConstraintReportPage": {
-                       "styles": "modules/SpecialConstraintReportPage.css",
+                       "styles": "modules/SpecialConstraintReportPage.less",
                        "scripts": "modules/SpecialConstraintReportPage.js"
                },
                "wikibase.quality.constraints.icon": {
@@ -82,13 +82,13 @@
                                "modules/ui/ConstraintReportList.js"
                        ],
                        "styles": [
-                               "modules/ui/ConstraintReportPanel.css",
-                               "modules/ui/ConstraintReportGroup.css"
+                               "modules/ui/ConstraintReportPanel.less",
+                               "modules/ui/ConstraintReportGroup.less"
                        ]
                },
                "wikibase.quality.constraints.gadget": {
                        "scripts": "modules/gadget.js",
-                       "styles": "modules/gadget.css",
+                       "styles": "modules/gadget.less",
                        "dependencies": [
                                "mediawiki.api",
                                "oojs-ui-core",
diff --git a/modules/SpecialConstraintReportPage.css 
b/modules/SpecialConstraintReportPage.less
similarity index 78%
rename from modules/SpecialConstraintReportPage.css
rename to modules/SpecialConstraintReportPage.less
index 3115b48..e0b8467 100644
--- a/modules/SpecialConstraintReportPage.css
+++ b/modules/SpecialConstraintReportPage.less
@@ -1,4 +1,7 @@
+@import 'mediawiki.ui/variables';
+
 /* named colors refer to the Wikimedia Style Guide, 
https://wikimedia.github.io/WikimediaUI-Style-Guide/visual-style_colors.html */
+/* TODO use some Less import for those as well (not part of 
'mediawiki.ui/variables') */
 
 /* Entity id form */
 form {
@@ -12,7 +15,7 @@
 
 .wbqc-constraintreport-notice-error {
        font-weight: bold;
-       color: #d33; /* Red50 */
+       color: @colorErrorText;
 }
 
 /* Statuses */
@@ -29,20 +32,20 @@
 }
 
 .wbqc-status-violation {
-       color: #d33; /* Red50 */
+       color: @colorErrorText;
 }
 
 .wbqc-status-todo {
-       color: #54595d; /* Base20 */
+       color: @colorTextLight;
 }
 
 .wbqc-status-bad-parameters {
-       color: #b32424; /* Red30 */
+       color: @colorDestructiveActive;
 }
 
 .wbqc-status-deprecated,
 .wbqc-status-not-main-snak {
-       color: #72777d; /* Base30 */
+       color: @colorNeutral;
 }
 
 .wbqc-status-warning {
@@ -51,7 +54,7 @@
 
 /* Tooltip */
 .wbqc-indicator {
-       color: #72777d; /* Base30 */
+       color: @colorNeutral;
        font-weight: 600;
 }
 
@@ -59,7 +62,7 @@
        margin-top: -40px;
        margin-left: -5px;
        background-color: #f8f9fa; /* Base90 */
-       border: 1px solid #a2a9b1; /* Base50 */
+       border: 1px solid @colorPlaceholder;
        border-radius: 5px;
        box-shadow: 2px 2px 1px rgba( 0, 0, 0, 0.2 );
        padding: 2px 5px 2px 5px;
@@ -84,6 +87,6 @@
 }
 
 .wbqc-expandable-content {
-       color: #222; /* Base10 */
+       color: @colorText;
        display: none;
 }
diff --git a/modules/gadget.css b/modules/gadget.css
deleted file mode 100644
index 3f7e1d5..0000000
--- a/modules/gadget.css
+++ /dev/null
@@ -1,10 +0,0 @@
-/* named colors refer to the Wikimedia Style Guide, 
https://wikimedia.github.io/WikimediaUI-Style-Guide/visual-style_colors.html */
-
-.wbqc-reports-button,
-.oo-ui-buttonElement.oo-ui-iconElement.wbqc-reports-button {
-       margin-left: 0.5em;
-}
-.wbqc-report,
-.wbqc-parameter-report {
-       border-top: 1px solid #eaecf0; /* Base80 */
-}
diff --git a/modules/gadget.less b/modules/gadget.less
new file mode 100644
index 0000000..e9276c5
--- /dev/null
+++ b/modules/gadget.less
@@ -0,0 +1,11 @@
+@import 'mediawiki.ui/variables';
+
+.wbqc-reports-button,
+.oo-ui-buttonElement.oo-ui-iconElement.wbqc-reports-button {
+       margin-left: 0.5em;
+}
+
+.wbqc-report,
+.wbqc-parameter-report {
+       border-top: 1px solid @colorShadow;
+}
diff --git a/modules/ui/ConstraintReportGroup.css 
b/modules/ui/ConstraintReportGroup.less
similarity index 100%
rename from modules/ui/ConstraintReportGroup.css
rename to modules/ui/ConstraintReportGroup.less
diff --git a/modules/ui/ConstraintReportPanel.css 
b/modules/ui/ConstraintReportPanel.css
deleted file mode 100644
index 19e61a7..0000000
--- a/modules/ui/ConstraintReportPanel.css
+++ /dev/null
@@ -1,10 +0,0 @@
-.wbqc-report h4:first-child + p {
-       margin-top: 0;
-}
-
-.wbqc-report .wbqc-constraint-type-help {
-       font-weight: normal;
-       float: right;
-       margin-left: 1.5em;
-       margin-right: 0.5em;
-}
diff --git a/modules/ui/ConstraintReportPanel.less 
b/modules/ui/ConstraintReportPanel.less
new file mode 100644
index 0000000..ea1755f
--- /dev/null
+++ b/modules/ui/ConstraintReportPanel.less
@@ -0,0 +1,12 @@
+.wbqc-report {
+       h4:first-child + p {
+               margin-top: 0;
+       }
+
+       .wbqc-constraint-type-help {
+               font-weight: normal;
+               float: right;
+               margin-left: 1.5em;
+               margin-right: 0.5em;
+       }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/389772
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5d53b985ddbfce5f3964fc5d5e32a8c1527a6596
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: WMDE-leszek <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to