Skip to content

Commit 6983c96

Browse files
committed
Accept option scope to scope the output css
1 parent 1298d2b commit 6983c96

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/processCss.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ module.exports = function processCss(inputSource, inputMap, options, callback) {
180180
}
181181
}).then(function(result) {
182182
callback(null, {
183-
source: result.css,
183+
source: (!query.scope ? result.css : result.css.replace(/\.[a-zA-Z_][^ ]+/g, function (cls) {
184+
return query.scope + ' ' + cls;
185+
})),
184186
map: result.map && result.map.toJSON(),
185187
exports: parserOptions.exports,
186188
importItems: parserOptions.importItems,

0 commit comments

Comments
 (0)