postcss-autoreset
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -8,2 +8,7 @@ # Change Log | ||
## [1.2.1] - 2016-10-09 | ||
Thnx to @giuseppeg and simonsmith for contribution! | ||
- Do not modify css if not required | ||
- Fix duplicate selector issue when using nested rulesets. ([#18](https://github.com/maximkoretskiy/postcss-autoreset/pull/18)) | ||
## [1.2.0] - 2016-09-29 | ||
@@ -10,0 +15,0 @@ - Improved accuracy of SUIT CSS regex (see https://github.com/maximkoretskiy/postcss-autoreset/pull/17 and https://github.com/maximkoretskiy/postcss-autoreset/issues/16). Thnx @giuseppeg and @simonsmith for suggestion and contribution. |
@@ -25,2 +25,6 @@ 'use strict'; | ||
var contains = function contains(array, item) { | ||
return array.indexOf(item) !== -1; | ||
}; | ||
exports.default = _postcss2.default.plugin('postcss-autoreset', function () { | ||
@@ -36,6 +40,9 @@ var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
css.walkRules(function (rule) { | ||
if (rulesMatcher(rule)) { | ||
matchedSelectors.push(rule.selector); | ||
var selector = rule.selector; | ||
if (!contains(matchedSelectors, selector) && rulesMatcher(rule)) { | ||
matchedSelectors.push(selector); | ||
} | ||
}); | ||
if (!matchedSelectors.length) return; | ||
css.prepend((0, _createResetRule2.default)(matchedSelectors, reset)); | ||
@@ -42,0 +49,0 @@ }; |
{ | ||
"name": "postcss-autoreset", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "PostCSS plugin for partial styles reset", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
11760
146