Skip to content

Commit

Permalink
add option.cssBase = workaround for webpack-contrib#163
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilan Copelyn committed Apr 4, 2017
1 parent 5f56f9f commit 4fde3cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions addStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module.exports = function(list, options) {
// By default, add <style> tags to the bottom of the target
if (typeof options.insertAt === "undefined") options.insertAt = "bottom";

var styles = listToStyles(list);
var styles = listToStyles(list, options);
addStylesToDom(styles, options);

return function update(newList) {
Expand All @@ -64,7 +64,7 @@ module.exports = function(list, options) {
mayRemove.push(domStyle);
}
if(newList) {
var newStyles = listToStyles(newList);
var newStyles = listToStyles(newList, options);
addStylesToDom(newStyles, options);
}
for(var i = 0; i < mayRemove.length; i++) {
Expand Down Expand Up @@ -100,12 +100,12 @@ function addStylesToDom(styles, options) {
}
}

function listToStyles(list) {
function listToStyles(list, options) {
var styles = [];
var newStyles = {};
for(var i = 0; i < list.length; i++) {
var item = list[i];
var id = item[0];
var id = item[0] + (options.cssBase || 0);
var css = item[1];
var media = item[2];
var sourceMap = item[3];
Expand Down

0 comments on commit 4fde3cd

Please sign in to comment.