Skip to content

Commit 68cb9e5

Browse files
committed
added postcss postcss-increase-specificity
1 parent 0840c80 commit 68cb9e5

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/processCss.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ var modulesScope = require("postcss-modules-scope");
1616
var modulesValues = require("postcss-modules-values");
1717
var valueParser = require('postcss-value-parser');
1818

19+
var postcssIncreaseSpecificity = require('postcss-increase-specificity');
20+
1921
var parserPlugin = postcss.plugin("css-loader-parser", function(options) {
2022
return function(css) {
2123
var imports = {};
@@ -158,6 +160,8 @@ module.exports = function processCss(inputSource, inputMap, options, callback) {
158160
resolve: options.resolve
159161
};
160162

163+
var increaseSpecificity = query.increaseSpecificity || {};
164+
161165
var pipeline = postcss([
162166
modulesValues,
163167
localByDefault({
@@ -186,7 +190,12 @@ module.exports = function processCss(inputSource, inputMap, options, callback) {
186190
});
187191
}
188192
}),
189-
parserPlugin(parserOptions)
193+
parserPlugin(parserOptions),
194+
postcssIncreaseSpecificity({
195+
stackableRoot: increaseSpecificity.stackableRoot || '',
196+
repeat: increaseSpecificity.repeat || 1,
197+
overrideIds: increaseSpecificity.overrideIds || true,
198+
})
190199
]);
191200

192201
if(minimize) {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"lodash.camelcase": "^4.3.0",
2121
"object-assign": "^4.0.1",
2222
"postcss": "^5.0.6",
23+
"postcss-increase-specificity": "^0.5.0",
2324
"postcss-modules-extract-imports": "^1.0.0",
2425
"postcss-modules-local-by-default": "^1.0.1",
2526
"postcss-modules-scope": "^1.0.0",

0 commit comments

Comments
 (0)