build: Enforce the rest of the colour-related stylelints

* 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
This commit is contained in:
James D. Forrester 2016-05-19 15:58:34 +01:00
parent 72b0d9da08
commit 276c30ebee
32 changed files with 109 additions and 106 deletions

View 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,
}
}

View 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: [

View file

@ -25,7 +25,7 @@ body {
border-left: 1px dotted #ccc;
float: right;
width: 230px;
background: white;
background: #fff;
margin: 0 0 10px 10px;
}

View file

@ -114,7 +114,7 @@
}
.error {
color: red;
color: #f00;
background-color: #fff;
font-weight: bold;
left: 1em;
@ -137,7 +137,7 @@
.success-message {
font-weight: bold;
font-size: 110%;
color: green;
color: #0f0;
}
.success-box {

View 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;
/*

View file

@ -1,7 +1,7 @@
.arrowSteps {
list-style-type: none;
list-style-image: none;
border: 1px solid #666666;
border: 1px solid #666;
position: relative;
}

View 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;
}

View 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;
@ -26,15 +26,15 @@
}
.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;
@ -48,27 +48,27 @@
.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 {

View file

@ -4,6 +4,6 @@
}
span.updatedmarker {
color: black;
color: #000;
background-color: #0f0;
}

View file

@ -72,7 +72,7 @@ td.diff-deletedline {
td.diff-context {
background: #f9f9f9;
border-color: #e6e6e6;
color: #333333;
color: #333;
}
.diffchange {

View 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%;

View file

@ -61,15 +61,15 @@
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);

View 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 **/

View 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;
}

View 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 */

View 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;
}

View 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;

View 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;

View file

@ -103,7 +103,7 @@ span.mw-protectedpages-actions {
font-size: 90%;
}
span.mw-protectedpages-unknown {
color: grey;
color: #808080;
font-size: 90%;
}

View 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 */
/*

View 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 {

View file

@ -21,12 +21,12 @@
}
}
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 {

View 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;
@ -120,13 +120,13 @@
&.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;
}
}
}
@ -136,12 +136,12 @@
}
&-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;
}
}

View 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 {
@ -121,8 +121,8 @@
&.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;
}
}

View 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;
@ -117,7 +117,7 @@
> .mw-widgets-stashedFileWidget-noThumbnail-icon {
opacity: 0.4;
background-color: #cccccc;
background-color: #ccc;
height: 5.5em;
width: 5.5em;
}
@ -160,7 +160,7 @@
}
.mw-widgets-stashedFileWidget-label {
color: #cccccc;
color: #ccc;
right: 0.5em;
}

View 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 {

View 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;

View file

@ -132,7 +132,7 @@ a.mw-debug-panelabel:visited {
}
td {
background-color: white;
background-color: #fff;
}
}

View file

@ -9,7 +9,7 @@
}
.mediawiki-filewarning-footer {
color: #888888;
color: #888;
}
.empty {

View 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 {

View 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 {

View 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;