build: Enforce the rest of the colour-related stylelints
authorJames D. Forrester <jforrester@wikimedia.org>
Thu, 19 May 2016 14:58:34 +0000 (15:58 +0100)
committerJames D. Forrester <jforrester@wikimedia.org>
Thu, 19 May 2016 16:22:41 +0000 (17:22 +0100)
* Hex colours must be in short form where possible ('fff' not 'ffffff')
* Hex colours must be used over named colours ('fff' not 'white')
* Hex colours must be valid ('fff' not 'ffq')

Change-Id: I2ba04cc3ad9898c17fee3c65bb3bead834c3a1fd

32 files changed:
.stylelintrc
Gruntfile.js
mw-config/config-cc.css
mw-config/config.css
resources/src/jquery.tipsy/jquery.tipsy.css
resources/src/jquery/jquery.arrowSteps.css
resources/src/jquery/jquery.badge.css
resources/src/jquery/jquery.suggestions.css
resources/src/mediawiki.action/mediawiki.action.history.css
resources/src/mediawiki.action/mediawiki.action.history.diff.css
resources/src/mediawiki.action/mediawiki.action.view.filepage.css
resources/src/mediawiki.action/mediawiki.action.view.postEdit.css
resources/src/mediawiki.legacy/oldshared.css
resources/src/mediawiki.legacy/shared.css
resources/src/mediawiki.skinning/content.css
resources/src/mediawiki.skinning/content.parsoid.less
resources/src/mediawiki.skinning/elements.css
resources/src/mediawiki.skinning/interface.css
resources/src/mediawiki.special/mediawiki.special.css
resources/src/mediawiki.special/mediawiki.special.preferences.styles.css
resources/src/mediawiki.special/mediawiki.special.search.css
resources/src/mediawiki.widgets.datetime/CalendarWidget.less
resources/src/mediawiki.widgets.datetime/DateTimeInputWidget.less
resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.less
resources/src/mediawiki.widgets/mw.widgets.StashedFileWidget.less
resources/src/mediawiki/mediawiki.apihelp.css
resources/src/mediawiki/mediawiki.content.json.css
resources/src/mediawiki/mediawiki.debug.less
resources/src/mediawiki/mediawiki.filewarning.less
resources/src/mediawiki/mediawiki.htmlform.css
resources/src/mediawiki/mediawiki.searchSuggest.css
resources/src/mediawiki/page/gallery.css

index bf74951..c6d9db4 100644 (file)
@@ -1,5 +1,8 @@
 {
        "rules": {
-               "color-hex-case": [ "lower" ]
+               "color-hex-case": [ "lower" ],
+               "color-hex-length": [ "short" ],
+               "color-named": [ "never" ],
+               "color-no-invalid-hex": true,
        }
 }
index 5af2d9c..a08db5c 100644 (file)
@@ -44,7 +44,7 @@ module.exports = function ( grunt ) {
                        options: {
                                syntax: 'less'
                        },
-                       src: '{resources/src/*,{mw-config,tests}/**}/*.{css,less}'
+                       src: '{resources/src/*,mw-config/**}/*.{css,less}'
                },
                watch: {
                        files: [
index 6cc94ab..29dc80c 100644 (file)
@@ -25,7 +25,7 @@ body {
        border-left: 1px dotted #ccc;
        float: right;
        width: 230px;
-       background: white;
+       background: #fff;
        margin: 0 0 10px 10px;
 }
 
index 0e0b304..66f8578 100644 (file)
 }
 
 .error {
-       color: red;
+       color: #f00;
        background-color: #fff;
        font-weight: bold;
        left: 1em;
 .success-message {
        font-weight: bold;
        font-size: 110%;
-       color: green;
+       color: #0f0;
 }
 
 .success-box {
index 33d9a00..5689256 100644 (file)
@@ -7,9 +7,9 @@
 .tipsy-inner {
        padding: 5px 8px 4px 8px;
        /*background-color: #e8f2f8;*/
-       background-color: #ffffff;
+       background-color: #fff;
        border: solid 1px #a7d7f9;
-       color: black;
+       color: #000;
        max-width: 15em;
        border-radius: 4px;
        /*
index f8f6e95..254836a 100644 (file)
@@ -1,7 +1,7 @@
 .arrowSteps {
        list-style-type: none;
        list-style-image: none;
-       border: 1px solid #666666;
+       border: 1px solid #666;
        position: relative;
 }
 
index 34cdf76..31158f7 100644 (file)
@@ -11,7 +11,7 @@
 
 .mw-badge-content {
        font-weight: bold;
-       color: white;
+       color: #fff;
        vertical-align: baseline;
        text-shadow: 0 1px rgba(0, 0, 0, 0.4);
 }
@@ -32,5 +32,5 @@
 }
 
 .mw-badge-important {
-       background-color: #cc0000;
+       background-color: #c00;
 }
index d42df12..f6b4fd1 100644 (file)
@@ -14,9 +14,9 @@
 
 .suggestions-special {
        position: relative;
-       background-color: white;
+       background-color: #fff;
        cursor: pointer;
-       border: solid 1px #aaaaaa;
+       border: solid 1px #aaa;
        padding: 0;
        margin: 0;
        margin-top: -2px;
 }
 
 .suggestions-results {
-       background-color: white;
+       background-color: #fff;
        cursor: pointer;
-       border: solid 1px #aaaaaa;
+       border: solid 1px #aaa;
        padding: 0;
        margin: 0;
 }
 
 .suggestions-result {
-       color: black;
+       color: #000;
        margin: 0;
        line-height: 1.5em;
        padding: 0.01em 0.25em;
 
 .suggestions-result-current {
        background-color: #4c59a6;
-       color: white;
+       color: #fff;
 }
 
 .suggestions-special .special-label {
-       color: gray;
+       color: #808080;
        text-align: left;
 }
 
 .suggestions-special .special-query {
-       color: black;
+       color: #000;
        font-style: italic;
        text-align: left;
 }
 
 .suggestions-special .special-hover {
-       background-color: silver;
+       background-color: #c0c0c0;
 }
 
 .suggestions-result-current .special-label,
 .suggestions-result-current .special-query {
-       color: white;
+       color: #fff;
 }
 
 .highlight {
index 292318c..835383e 100644 (file)
@@ -4,6 +4,6 @@
 }
 
 span.updatedmarker {
-       color: black;
+       color: #000;
        background-color: #0f0;
 }
index 0887476..9db6777 100644 (file)
@@ -72,7 +72,7 @@ td.diff-deletedline {
 td.diff-context {
        background: #f9f9f9;
        border-color: #e6e6e6;
-       color: #333333;
+       color: #333;
 }
 
 .diffchange {
index 5112728..450517e 100644 (file)
@@ -38,7 +38,7 @@ table.filehistory td.filehistory-selected {
 .filehistory a img,
 #file img:hover {
        /* @embed */
-       background: white url(images/checker.png) repeat;
+       background: #fff url(images/checker.png) repeat;
 }
 
 /*
@@ -46,7 +46,7 @@ table.filehistory td.filehistory-selected {
  */
 ul#filetoc {
        text-align: center;
-       border: 1px solid #aaaaaa;
+       border: 1px solid #aaa;
        background-color: #f9f9f9;
        padding: 5px;
        font-size: 95%;
index db89990..a02b4b4 100644 (file)
        font-size: 1.25em;
        font-weight: bold;
        line-height: 2.3em;
-       color: black;
-       text-shadow: 0 0.0625em 0 white;
+       color: #000;
+       text-shadow: 0 0.0625em 0 #fff;
        text-decoration: none;
        opacity: 0.2;
        filter: alpha(opacity=20);
 }
 
 .postedit-close:hover {
-       color: black;
+       color: #000;
        text-decoration: none;
        opacity: 0.4;
        filter: alpha(opacity=40);
index ff60ce7..c58bcc8 100644 (file)
@@ -80,7 +80,7 @@ table.rimage {
 div.thumb {
        margin-bottom: .5em;
        border-style: solid;
-       border-color: white;
+       border-color: #fff;
        width: auto;
 }
 
@@ -147,7 +147,7 @@ div.tleft {
 }
 
 img.thumbborder {
-       border: 1px solid #dddddd;
+       border: 1px solid #ddd;
 }
 
 /* Page history styling */
@@ -212,7 +212,7 @@ table.toc td {
 }
 
 .error {
-       color: red;
+       color: #f00;
        font-size: larger;
 }
 
@@ -224,12 +224,12 @@ table.toc td {
 }
 
 #preftoc li {
-       border: 1px solid White;
+       border: 1px solid #fff;
 }
 
 #preftoc li.selected {
        background-color: #f9f9f9;
-       border: 1px dashed #aaaaaa;
+       border: 1px dashed #aaa;
 }
 
 #preftoc a,
@@ -272,14 +272,14 @@ table.small {
 
 /* use this instead of #toc for page content */
 .toccolours {
-       border: 1px solid #aaaaaa;
+       border: 1px solid #aaa;
        background-color: #f9f9f9;
        padding: 5px;
        font-size: 95%;
 }
 
 #siteNotice {
-       border: 1px solid #aaaaaa;
+       border: 1px solid #aaa;
        padding-left: 0.5em;
        padding-right: 0.5em;
 }
@@ -290,12 +290,12 @@ table.small {
 
 span.unpatrolled {
        font-weight: bold;
-       color: red;
+       color: #f00;
 }
 
 span.updatedmarker {
-       color: black;
-       background-color: #00ff00;
+       color: #000;
+       background-color: #0f0;
 }
 
 div.gallerybox {
@@ -308,14 +308,14 @@ span.comment {
 
 .previewnote {
        text-align: center;
-       color: #cc0000;
+       color: #c00;
 }
 
 .editExternally {
        border-style: solid;
        border-width: 1px;
-       border-color: gray;
-       background: #ffffff;
+       border-color: #808080;
+       background: #fff;
        padding: 3px;
        margin-top: 0.5em;
        float: left;
@@ -325,7 +325,7 @@ span.comment {
 
 .editExternallyHelp {
        font-style: italic;
-       color: gray;
+       color: #808080;
 }
 
 li span.deleted {
@@ -358,7 +358,7 @@ table.mw_metadata {
 
 table.mw_metadata td,
 table.mw_metadata th {
-       border: 1px solid #aaaaaa;
+       border: 1px solid #aaa;
        padding-left: 4px;
        padding-right: 4px;
 }
@@ -403,7 +403,7 @@ table.mw_metadata td.spacer {
 }
 
 div.multipageimagenavbox {
-       border: solid 1px silver;
+       border: solid 1px #c0c0c0;
        padding: 4px;
        margin: 1em;
        background: #f0f0f0;
@@ -450,7 +450,7 @@ body {
 }
 
 body.ns-0 {
-       background-color: white;
+       background-color: #fff;
 }
 
 /** RTL specific CSS starts here **/
index 95e19b1..e18ef69 100644 (file)
@@ -44,8 +44,8 @@
 
 /* User-Agent styles for new HTML5 elements */
 mark {
-       background-color: yellow;
-       color: black;
+       background-color: #ff0;
+       color: #000;
 }
 
 /* Helper for wbr element on IE 8+; in HTML5, but not supported by default as of IE 11. */
@@ -156,7 +156,7 @@ span.history-deleted {
 
 .unpatrolled {
        font-weight: bold;
-       color: red;
+       color: #f00;
 }
 
 div.patrollink {
@@ -288,7 +288,7 @@ p.mw-delete-editreasons {
 
 /* The auto-generated edit comments */
 .autocomment {
-       color: gray;
+       color: #808080;
 }
 
 #pagehistory .history-user {
@@ -297,7 +297,7 @@ p.mw-delete-editreasons {
 }
 
 #pagehistory li {
-       border: 1px solid white;
+       border: 1px solid #fff;
 }
 
 #pagehistory li.selected {
@@ -378,7 +378,7 @@ table.wikitable {
        background-color: #f9f9f9;
        border: 1px solid #aaa;
        border-collapse: collapse;
-       color: black;
+       color: #000;
 }
 
 table.wikitable > tr > th,
@@ -407,7 +407,7 @@ table.wikitable > caption {
 }
 
 .error {
-       color: #cc0000;
+       color: #c00;
 }
 
 .warning {
@@ -441,7 +441,7 @@ table.wikitable > caption {
 }
 
 .errorbox {
-       color: #cc0000;
+       color: #c00;
        border-color: #fac5c5;
        background-color: #fae3e3;
 }
@@ -504,20 +504,20 @@ table.wikitable > caption {
 .mw-datatable,
 .mw-datatable td,
 .mw-datatable th {
-       border: 1px solid #aaaaaa;
+       border: 1px solid #aaa;
        padding: 0 0.15em 0 0.15em;
 }
 
 .mw-datatable th {
-       background-color: #ddddff;
+       background-color: #ddf;
 }
 
 .mw-datatable td {
-       background-color: #ffffff;
+       background-color: #fff;
 }
 
 .mw-datatable tr:hover td {
-       background-color: #eeeeff;
+       background-color: #eef;
 }
 
 /* Classes for Exif data display */
@@ -548,7 +548,7 @@ table.mw_metadata {
 
 table.mw_metadata td,
 table.mw_metadata th {
-       border: 1px solid #aaaaaa;
+       border: 1px solid #aaa;
        padding-left: 5px;
        padding-right: 5px;
 }
index 89f8745..38f33be 100644 (file)
@@ -198,7 +198,7 @@ div.magnify a {
 }
 
 img.thumbborder {
-       border: 1px solid #dddddd;
+       border: 1px solid #ddd;
 }
 
 /* Directionality-specific styles for thumbnails - their positioning depends on content language */
index 99d465b..74911b7 100644 (file)
@@ -126,7 +126,7 @@ figure[typeof~='mw:Image/Frame'] {
 figure[typeof~='mw:Image/Thumb'] > *:first-child > img,
 figure[typeof~='mw:Image/Frame'] > *:first-child > img,
 .mw-image-border > *:first-child > img {
-       border: 1px solid #cccccc;
+       border: 1px solid #ccc;
        margin: 3px;
 }
 
index 7872085..f267784 100644 (file)
@@ -34,7 +34,7 @@ a:lang(ur) {
 }
 
 a.stub {
-       color: #772233;
+       color: #723;
 }
 
 a.new, #p-personal a.new {
@@ -97,7 +97,7 @@ h3,
 h4,
 h5,
 h6 {
-       color: black;
+       color: #000;
        background: none;
        font-weight: normal;
        margin: 0;
@@ -199,7 +199,7 @@ pre, code, tt, kbd, samp, .mw-code {
 }
 
 code {
-       color: black;
+       color: #000;
        background-color: #f9f9f9;
        border: 1px solid #ddd;
        border-radius: 2px;
@@ -208,7 +208,7 @@ code {
 
 pre,
 .mw-code {
-       color: black;
+       color: #000;
        background-color: #f9f9f9;
        border: 1px solid #ddd;
        padding: 1em;
index 80a2ff4..8b07721 100644 (file)
@@ -17,7 +17,7 @@
 
 .editOptions {
        background-color: #f0f0f0;
-       border: 1px solid silver;
+       border: 1px solid #c0c0c0;
        border-top: none;
        padding: 1em 1em 1.5em 1em;
        margin-bottom: 2em;
@@ -26,7 +26,7 @@
 .usermessage {
        background-color: #ffce7b;
        border: 1px solid #ffa500;
-       color: black;
+       color: #000;
        font-weight: bold;
        margin: 2em 0 1em;
        padding: .5em 1em;
index 15f4e4d..f2019e7 100644 (file)
@@ -103,7 +103,7 @@ span.mw-protectedpages-actions {
        font-size: 90%;
 }
 span.mw-protectedpages-unknown {
-       color: grey;
+       color: #808080;
        font-size: 90%;
 }
 
index e05d163..4c9c41e 100644 (file)
@@ -3,7 +3,7 @@
 .mw-email-none .mw-input{
        border: 1px solid #fde29b;
        background-color: #fdf1d1;
-       color: #000000;
+       color: #000;
 }
 /* Authenticated email field has its own class too. Unstyled by default */
 /*
index 1ce526d..a281309 100644 (file)
@@ -44,13 +44,13 @@ div.searchresult {
        font-size: 108%;
 }
 .mw-search-result-data {
-       color: green;
+       color: #0f0;
        font-size: 97%;
 }
 .mw-search-profile-tabs {
        background-color: #f3f3f3;
        margin-top: 1em;
-       border: 1px solid silver;
+       border: 1px solid #c0c0c0;
 }
 .mw-search-profile-tabs div.search-types {
        float: left;
@@ -71,7 +71,7 @@ div.searchresult {
        padding: 0.5em;
 }
 .mw-search-profile-tabs div.search-types ul li.current a {
-       color: #333333;
+       color: #333;
        cursor: default;
 }
 .mw-search-profile-tabs div.search-types ul li.current a:hover {
@@ -90,7 +90,7 @@ fieldset#mw-searchoptions {
        padding: 0.5em 0.75em 0.75em 0.75em;
        border: none;
        background-color: #f9f9f9;
-       border: 1px solid silver;
+       border: 1px solid #c0c0c0;
        border-top-width: 0;
 }
 fieldset#mw-searchoptions legend {
index a7beb0d..74c75ea 100644 (file)
                }
        }
 
-       background-color: white;
+       background-color: #fff;
        border: 1px solid #ccc;
 
        &.mw-widgets-datetime-calendarWidget-dependent {
                margin-top: -1px;
-               border-top: 1px solid white;
+               border-top: 1px solid #fff;
        }
 
        &-heading {
index bc387df..84788d2 100644 (file)
@@ -51,7 +51,7 @@
                padding: 0 1em;
                margin: 0;
                background-color: #fff;
-               color: black;
+               color: #000;
                border: solid 1px #ccc;
                box-shadow: inset 0 0 0 0 @progressive;
                border-radius: 0.1em;
 
                &.oo-ui-flaggedElement-invalid {
                        .mw-widgets-datetime-dateTimeInputWidget-handle {
-                               border-color: red;
-                               box-shadow: inset 0 0 0 0 red;
+                               border-color: #f00;
+                               box-shadow: inset 0 0 0 0 #f00;
                        }
 
                        .mw-widgets-datetime-dateTimeInputWidget-handle:focus {
-                               border-color: red;
-                               box-shadow: inset 0 0 0 0.1em red;
+                               border-color: #f00;
+                               box-shadow: inset 0 0 0 0.1em #f00;
                        }
                }
        }
        }
 
        &-editField.mw-widgets-datetime-dateTimeInputWidget-invalid {
-               border: 1px solid red;
-               box-shadow: inset 0 0 0 0 red;
+               border: 1px solid #f00;
+               box-shadow: inset 0 0 0 0 #f00;
 
                &:focus {
-                       border: 1px solid red;
-                       box-shadow: inset 0 0 0 0.1em red;
+                       border: 1px solid #f00;
+                       box-shadow: inset 0 0 0 0.1em #f00;
                }
        }
 
index 873cca1..ee571cb 100644 (file)
@@ -74,7 +74,7 @@
                border: 1px solid #ccc;
                border-radius: 0.1em;
                line-height: 1.275em;
-               background-color: white;
+               background-color: #fff;
        }
 
        &.oo-ui-indicatorElement .mw-widget-dateInputWidget-handle > .oo-ui-indicatorElement-indicator {
@@ -91,7 +91,7 @@
        }
 
        &-calendar {
-               background-color: white;
+               background-color: #fff;
                margin-top: -2px;
 
                &:focus {
 
        &.oo-ui-flaggedElement-invalid {
                .mw-widget-dateInputWidget-handle {
-                       border-color: red;
-                       box-shadow: inset 0 0 0 0 red;
+                       border-color: #f00;
+                       box-shadow: inset 0 0 0 0 #f00;
                }
        }
 
index cf9496f..ecfc880 100644 (file)
@@ -20,8 +20,8 @@
 
 .mw-widgets-stashedFileWidget-info {
        height: 2.4em;
-       background-color: #ffffff;
-       border: 1px solid #cccccc;
+       background-color: #fff;
+       border: 1px solid #ccc;
        border-radius: 2px;
        width: 100%;
        display: table-cell;
@@ -51,7 +51,7 @@
                        float: left;
                }
                > .mw-widgets-stashedFileWidget-fileType {
-                       color: #888888;
+                       color: #888;
                        float: right;
                }
        }
@@ -79,9 +79,9 @@
 
        &.oo-ui-widget-disabled {
                .mw-widgets-stashedFileWidget-info {
-                       color: #cccccc;
-                       text-shadow: 0 1px 1px #ffffff;
-                       border-color: #dddddd;
+                       color: #ccc;
+                       text-shadow: 0 1px 1px #fff;
+                       border-color: #ddd;
                        background-color: #f3f3f3;
 
                        > .oo-ui-iconElement-icon,
@@ -97,8 +97,8 @@
        height: 5.5em;
        text-align: left;
        padding: 0;
-       background-color: #ffffff;
-       border: 1px solid #cccccc;
+       background-color: #fff;
+       border: 1px solid #ccc;
        margin-bottom: 0.5em;
        vertical-align: middle;
        overflow: hidden;
 
                > .mw-widgets-stashedFileWidget-noThumbnail-icon {
                        opacity: 0.4;
-                       background-color: #cccccc;
+                       background-color: #ccc;
                        height: 5.5em;
                        width: 5.5em;
                }
        }
 
        .mw-widgets-stashedFileWidget-label {
-               color: #cccccc;
+               color: #ccc;
                right: 0.5em;
        }
 
index a35ce7a..365e988 100644 (file)
@@ -28,7 +28,7 @@ div.apihelp-linktrail {
 .apihelp-flags {
        font-size: smaller;
        float: right;
-       border: 1px solid black;
+       border: 1px solid #000;
        padding: 0.25em;
        width: 20em;
 }
@@ -36,7 +36,7 @@ div.apihelp-linktrail {
 .apihelp-deprecated, .apihelp-flag-deprecated,
 .apihelp-flag-internal strong {
        font-weight: bold;
-       color: red;
+       color: #f00;
 }
 
 .apihelp-unknown {
index 9e20264..91fa02a 100644 (file)
@@ -13,7 +13,7 @@
 
 .mw-json th,
 .mw-json td {
-       border: 1px solid gray;
+       border: 1px solid #808080;
        font-size: 16px;
        padding: 0.5em 1em;
 }
@@ -50,7 +50,7 @@
 }
 
 .mw-json table caption {
-       color: gray;
+       color: #808080;
        display: inline-block;
        font-size: 10px;
        font-style: italic;
index a4e3710..bc5e0da 100644 (file)
@@ -132,7 +132,7 @@ a.mw-debug-panelabel:visited {
        }
 
        td {
-               background-color: white;
+               background-color: #fff;
        }
 }
 
index f4af4ba..89efae3 100644 (file)
@@ -9,7 +9,7 @@
        }
 
        .mediawiki-filewarning-footer {
-               color: #888888;
+               color: #888;
        }
 
        .empty {
index c3341bb..9405f6b 100644 (file)
@@ -5,7 +5,7 @@ table.mw-htmlform-nolabel td.mw-label {
 }
 
 .mw-htmlform-invalid-input td.mw-input input {
-       border-color: red;
+       border-color: #f00;
 }
 
 .mw-htmlform-flatlist div.mw-htmlform-flatlist-item {
index df144ce..ce3cfbd 100644 (file)
@@ -4,7 +4,7 @@
 .suggestions a.mw-searchSuggest-link:hover,
 .suggestions a.mw-searchSuggest-link:active,
 .suggestions a.mw-searchSuggest-link:focus {
-       color: black;
+       color: #000;
        text-decoration: none;
 }
 
@@ -12,7 +12,7 @@
 .suggestions-result-current a.mw-searchSuggest-link:hover,
 .suggestions-result-current a.mw-searchSuggest-link:active,
 .suggestions-result-current a.mw-searchSuggest-link:focus {
-       color: white;
+       color: #fff;
 }
 
 .suggestions a.mw-searchSuggest-link .special-query {
index 3c80bbb..4d43e6a 100644 (file)
@@ -84,7 +84,7 @@ ul.mw-gallery-packed-hover li.gallerybox:hover div.gallerytextwrapper,
 ul.mw-gallery-packed-overlay li.gallerybox div.gallerytextwrapper,
 ul.mw-gallery-packed-hover li.gallerybox.mw-gallery-focused div.gallerytextwrapper {
        position: absolute;
-       background: white;
+       background: #fff;
        background: rgba(255, 255, 255, 0.8);
        padding: 5px 10px;
        bottom: 0;