[MediaWiki-commits] [Gerrit] Add selector whitespace to stylelint - change (oojs/ui)

2016-05-19 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add selector whitespace to stylelint
..


Add selector whitespace to stylelint

Adding selector whitespace rules, compare
https://www.mediawiki.org/wiki/Manual:Coding_conventions/CSS#Whitespace
Leaving single colon in to make IE 6-8 happy.

Change-Id: Ic0a3e39f47aeb110ef0b04743ecb71aab84e62e4
---
M .stylelintrc
M build/tasks/colorize-svg.js
M demos/styles/demo.css
M src/styles/common.less
M src/themes/apex/widgets.less
5 files changed, 22 insertions(+), 8 deletions(-)

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



diff --git a/.stylelintrc b/.stylelintrc
index 47e6ba3..6c88add 100644
--- a/.stylelintrc
+++ b/.stylelintrc
@@ -42,6 +42,17 @@
"function-url-quotes": [ "none" ],
"function-whitespace-after": [ "always" ],
 
+   "selector-combinator-space-after": [ "always" ],
+   "selector-combinator-space-before": [ "always" ],
+   "selector-no-vendor-prefix": true,
+   "selector-root-no-composition": true,
+   "selector-pseudo-element-colon-notation": [ "single" ],
+
+   "selector-list-comma-newline-after": [ "always" ],
+   "selector-list-comma-newline-before": [ "never-multi-line" ],
+   "selector-list-comma-space-after": [ "always-single-line" ],
+   "selector-list-comma-space-before": [ "never" ],
+
"string-no-newline": true,
 
"value-list-comma-newline-after": [ "never-multi-line" ],
diff --git a/build/tasks/colorize-svg.js b/build/tasks/colorize-svg.js
index 9eb11c7..28b2d8d 100644
--- a/build/tasks/colorize-svg.js
+++ b/build/tasks/colorize-svg.js
@@ -181,7 +181,7 @@
function getDeclarations( primary ) {
// If 'primary' is not a SVG file, 'fallback' and 
'primary' are intentionally the same
var fallback = primary.replace( /\.svg$/, '.png' );
-   return '.oo-ui-background-image-svg2(' +
+   return '.oo-ui-background-image-svg-internal(' +
'\'' + ( cssPrependPath || '' ) + primary + 
'\', ' +
'\'' + ( cssPrependPath || '' ) + fallback + 
'\'' +
')';
diff --git a/demos/styles/demo.css b/demos/styles/demo.css
index be9dc89..b2a432d 100644
--- a/demos/styles/demo.css
+++ b/demos/styles/demo.css
@@ -97,7 +97,7 @@
 }
 
 /* Console */
-
+/* stylelint-disable selector-pseudo-element-colon-notation */
 .oo-ui-demo-console {
clear: both;
position: relative;
@@ -241,3 +241,4 @@
background: #eee;
color: #333;
 }
+/* stylelint-enable selector-pseudo-element-colon-notation */
\ No newline at end of file
diff --git a/src/styles/common.less b/src/styles/common.less
index 9ca943f..0f45c39 100644
--- a/src/styles/common.less
+++ b/src/styles/common.less
@@ -15,23 +15,23 @@
background-image: e( '/* @embed */' ) url( ~'@{url}' ); // 
stylelint-disable-line function-url-quotes
 }
 
-.oo-ui-background-image-svg2( @svg, @fallback ) when ( @oo-ui-distribution = 
mixed ) {
+.oo-ui-background-image-svg-internal( @svg, @fallback ) when ( 
@oo-ui-distribution = mixed ) {
background-image: url( @fallback );
background-image: -webkit-linear-gradient( transparent, transparent ), 
e( '/* @embed */' ) url( @svg );
background-image: linear-gradient( transparent, transparent ), e( '/* 
@embed */' ) url( @svg );
background-image: -o-linear-gradient( transparent, transparent ), url( 
@fallback );
 }
-.oo-ui-background-image-svg2( @svg, @fallback ) when ( @oo-ui-distribution = 
vector ) {
+.oo-ui-background-image-svg-internal( @svg, @fallback ) when ( 
@oo-ui-distribution = vector ) {
.oo-ui-background-image( @svg );
 }
-.oo-ui-background-image-svg2( @svg, @fallback ) when ( @oo-ui-distribution = 
raster ) {
+.oo-ui-background-image-svg-internal( @svg, @fallback ) when ( 
@oo-ui-distribution = raster ) {
.oo-ui-background-image( @fallback );
 }
 
 .oo-ui-background-image-svg( @url-without-extension ) {
@svg: '@{url-without-extension}.svg';
@fallback: '@{url-without-extension}.@{oo-ui-default-image-ext}';
-   .oo-ui-background-image-svg2( @svg, @fallback );
+   .oo-ui-background-image-svg-internal( @svg, @fallback );
 }
 
 .oo-ui-force-webkit-gpu() {
diff --git a/src/themes/apex/widgets.less b/src/themes/apex/widgets.less
index 63bd10b..19e1627 100644
--- a/src/themes/apex/widgets.less
+++ b/src/themes/apex/widgets.less
@@ -274,7 +274,8 @@
}
 
// No close, no indicator:
-   &-empty, &-notsupported {
+   &-empty,
+   &-notsupported {
.oo-ui-selectFileWidget-info {
.oo-ui-selectFileWidget-label {

[MediaWiki-commits] [Gerrit] Add selector whitespace to stylelint - change (oojs/ui)

2016-05-17 Thread VolkerE (Code Review)
VolkerE has uploaded a new change for review.

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

Change subject: Add selector whitespace to stylelint
..

Add selector whitespace to stylelint

Adding selector whitespace rules, compare
https://www.mediawiki.org/wiki/Manual:Coding_conventions/CSS#Whitespace
Leaving single colon in to make IE 6-8 happy.

Change-Id: Ic0a3e39f47aeb110ef0b04743ecb71aab84e62e4
---
M .stylelintrc
M demos/styles/demo.css
M src/styles/common.less
M src/themes/apex/widgets.less
4 files changed, 22 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/38/289338/1

diff --git a/.stylelintrc b/.stylelintrc
index 4eddef9..68b3e4c 100644
--- a/.stylelintrc
+++ b/.stylelintrc
@@ -45,6 +45,17 @@
"block-closing-brace-space-before": [ "always-single-line" ],
"block-opening-brace-newline-after": [ "always-multi-line" ],
"block-opening-brace-space-after": [ "always-single-line" ],
-   "block-opening-brace-space-before": [ "always" ]
+   "block-opening-brace-space-before": [ "always" ],
+
+   "selector-combinator-space-after": [ "always" ],
+   "selector-combinator-space-before": [ "always" ],
+   "selector-no-vendor-prefix": true,
+   "selector-root-no-composition": true,
+   "selector-pseudo-element-colon-notation": [ "single" ],
+
+   "selector-list-comma-newline-after": [ "always" ],
+   "selector-list-comma-newline-before": [ "never-multi-line" ],
+   "selector-list-comma-space-after": [ "always-single-line" ],
+   "selector-list-comma-space-before": [ "never" ]
}
 }
\ No newline at end of file
diff --git a/demos/styles/demo.css b/demos/styles/demo.css
index be9dc89..b2a432d 100644
--- a/demos/styles/demo.css
+++ b/demos/styles/demo.css
@@ -97,7 +97,7 @@
 }
 
 /* Console */
-
+/* stylelint-disable selector-pseudo-element-colon-notation */
 .oo-ui-demo-console {
clear: both;
position: relative;
@@ -241,3 +241,4 @@
background: #eee;
color: #333;
 }
+/* stylelint-enable selector-pseudo-element-colon-notation */
\ No newline at end of file
diff --git a/src/styles/common.less b/src/styles/common.less
index 8d165e8..b3b425d 100644
--- a/src/styles/common.less
+++ b/src/styles/common.less
@@ -15,23 +15,23 @@
background-image: e( '/* @embed */' ) url( ~@{url} );
 }
 
-.oo-ui-background-image-svg2( @svg, @fallback ) when ( @oo-ui-distribution = 
mixed ) {
+.oo-ui-background-image-svg2( @svg, @fallback ) when ( @oo-ui-distribution = 
mixed ) { // stylelint-disable-line selector-list-comma-newline-after
background-image: url( @fallback );
background-image: -webkit-linear-gradient( transparent, transparent ), 
e( '/* @embed */' ) url( @svg );
background-image: linear-gradient( transparent, transparent ), e( '/* 
@embed */' ) url( @svg );
background-image: -o-linear-gradient( transparent, transparent ), url( 
@fallback );
 }
-.oo-ui-background-image-svg2( @svg, @fallback ) when ( @oo-ui-distribution = 
vector ) {
+.oo-ui-background-image-svg2( @svg, @fallback ) when ( @oo-ui-distribution = 
vector ) { // stylelint-disable-line selector-list-comma-newline-after
.oo-ui-background-image( @svg );
 }
-.oo-ui-background-image-svg2( @svg, @fallback ) when ( @oo-ui-distribution = 
raster ) {
+.oo-ui-background-image-svg2( @svg, @fallback ) when ( @oo-ui-distribution = 
raster ) { // stylelint-disable-line selector-list-comma-newline-after
.oo-ui-background-image( @fallback );
 }
 
 .oo-ui-background-image-svg( @url-without-extension ) {
@svg: '@{url-without-extension}.svg';
@fallback: '@{url-without-extension}.@{oo-ui-default-image-ext}';
-   .oo-ui-background-image-svg2( @svg, @fallback );
+   .oo-ui-background-image-svg2( @svg, @fallback ); // 
stylelint-disable-line selector-list-comma-newline-after
 }
 
 .oo-ui-force-webkit-gpu() {
diff --git a/src/themes/apex/widgets.less b/src/themes/apex/widgets.less
index 168ab39..3c5e0eb 100644
--- a/src/themes/apex/widgets.less
+++ b/src/themes/apex/widgets.less
@@ -274,7 +274,8 @@
}
 
// No close, no indicator:
-   &-empty, &-notsupported {
+   &-empty,
+   &-notsupported {
.oo-ui-selectFileWidget-info {
.oo-ui-selectFileWidget-label {
right: 0.5em;
@@ -283,7 +284,8 @@
}
 
// No close, with indicator:
-   &-empty.oo-ui-indicatorElement, &-notsupported.oo-ui-indicatorElement {
+   &-empty.oo-ui-indicatorElement,
+   &-notsupported.oo-ui-indicatorElement {
.oo-ui-selectFileWidget-info {
.oo-ui-selectFileWidget-label {
right: 2em;

-- 
To view, visit