postcss-prefix-selector
Advanced tools
Comparing version
35
index.js
@@ -9,19 +9,20 @@ module.exports = function postcssPrefixSelector(options) { | ||
return function (root) { | ||
if ( | ||
ignoreFiles.length && | ||
root.source.input.file && | ||
isFileInArray(root.source.input.file, ignoreFiles) | ||
) { | ||
return; | ||
} | ||
if ( | ||
includeFiles.length && | ||
root.source.input.file && | ||
!isFileInArray(root.source.input.file, includeFiles) | ||
) { | ||
return; | ||
} | ||
return { | ||
postcssPlugin: 'postcss-prefix-selector', | ||
Rule(rule) { | ||
if ( | ||
ignoreFiles.length && | ||
rule.source.input.file && | ||
isFileInArray(rule.source.input.file, ignoreFiles) | ||
) { | ||
return; | ||
} | ||
if ( | ||
includeFiles.length && | ||
rule.source.input.file && | ||
!isFileInArray(rule.source.input.file, includeFiles) | ||
) { | ||
return; | ||
} | ||
root.walkRules((rule) => { | ||
const keyframeRules = [ | ||
@@ -53,3 +54,3 @@ 'keyframes', | ||
}); | ||
}); | ||
}, | ||
}; | ||
@@ -56,0 +57,0 @@ }; |
{ | ||
"name": "postcss-prefix-selector", | ||
"description": "Prefix all CSS rules with a selector", | ||
"version": "1.10.0", | ||
"version": "1.11.0", | ||
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)", | ||
@@ -14,3 +14,3 @@ "contributors": [ | ||
"dependencies": { | ||
"postcss": "^8.2.10" | ||
"postcss": "^8.3.6" | ||
}, | ||
@@ -22,2 +22,3 @@ "devDependencies": { | ||
"mocha": "~7.2.0", | ||
"postcss-nested": "^5.0.6", | ||
"prettier": "^2.0.0" | ||
@@ -24,0 +25,0 @@ }, |
@@ -123,7 +123,9 @@ # postcss-prefix-selector | ||
- `prefix` - This string is added before every CSS selector. | ||
- `exclude` - It's possible to avoid prefixing some selectors by passing an array of selectors (strings or regular expressions). | ||
- `transform` - In cases where you may want to use the prefix differently for different selectors, it is possible to pass in a custom transform method. | ||
- `ignoreFiles` - List of ignored files for processing. | ||
- `includeFiles` - List of included files for processing. | ||
| Name | Type | Description | | ||
|-|-|-| | ||
| `prefix` | `string` | This string is added before every CSS selector | | ||
| `exclude` | `string[]` or `RegExp[]` | It's possible to avoid prefixing some selectors by passing an array of selectors | | ||
| `transform` | `Function` | In cases where you may want to use the prefix differently for different selectors, it is possible to pass in a custom transform method | | ||
| `ignoreFiles` | `string[]` or `RegExp[]` | List of ignored files for processing | | ||
| `includeFiles` | `string[]` or `RegExp[]` | List of included files for processing | | ||
@@ -130,0 +132,0 @@ ## Maintainer |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
9636
2.04%65
1.56%159
1.27%6
20%1
Infinity%Updated