postcss-nested
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -0,1 +1,4 @@ | ||
## 0.2.1 | ||
* Add comma support to selectors unwrap. | ||
## 0.2 | ||
@@ -2,0 +5,0 @@ * Use PostCSS 4.0. |
20
index.js
@@ -0,7 +1,17 @@ | ||
var list = require('postcss/lib/list'); | ||
var selector = function (parent, node) { | ||
if ( node.selector.indexOf('&') == -1 ) { | ||
return parent.selector + ' ' + node.selector; | ||
} else { | ||
return node.selector.replace(/&/g, parent.selector); | ||
} | ||
return list.comma(parent.selector) | ||
.map(function (i) { | ||
return list.comma(node.selector) | ||
.map(function (j) { | ||
if ( j.indexOf('&') == -1 ) { | ||
return i + ' ' + j; | ||
} else { | ||
return j.replace(/&/g, i); | ||
} | ||
}) | ||
.join(', '); | ||
}) | ||
.join(', '); | ||
}; | ||
@@ -8,0 +18,0 @@ |
{ | ||
"name": "postcss-nested", | ||
"version": "0.2.0", | ||
"description": "PostCSS plugin to unwrap nested rules like it Sass does", | ||
"version": "0.2.1", | ||
"description": "PostCSS plugin to unwrap nested rules like how Sass does it.", | ||
"keywords": ["postcss", "sass", "css", "nested"], | ||
@@ -17,5 +17,5 @@ "author": "Andrey Sitnik <andrey@sitnik.ru>", | ||
"jshint-stylish": "1.0.0", | ||
"gulp-jshint": "1.9.0", | ||
"gulp-jshint": "1.9.1", | ||
"gulp-mocha": "2.0.0", | ||
"postcss": "4.0.0", | ||
"postcss": "4.0.3", | ||
"mocha": "2.1.0", | ||
@@ -22,0 +22,0 @@ "chai": "1.10.0", |
@@ -6,3 +6,3 @@ # PostCSS Nested [![Build Status](https://travis-ci.org/postcss/postcss-nested.svg)](https://travis-ci.org/postcss/postcss-nested) | ||
[PostCSS](https://github.com/postcss/postcss) plugin to unwrap nested rules | ||
like it Sass does. | ||
like how Sass does it. | ||
@@ -9,0 +9,0 @@ ```css |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5713
60