Skip to content

Commit

Permalink
Merge 2b4d4ca into a63f7a7
Browse files Browse the repository at this point in the history
  • Loading branch information
vzaidman committed Apr 24, 2018
2 parents a63f7a7 + 2b4d4ca commit 50fe6b4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions plugins/prefixIds.js
Expand Up @@ -164,14 +164,18 @@ exports.fn = function(node, opts, extra) {
var idPrefixed = '';
csstree.walk(cssAst, function(node) {

// #ID, .class
if ((node.type === 'IdSelector' ||
node.type === 'ClassSelector') &&
node.name) {
// #ID,
if (node.type === 'IdSelector' && node.name) {
node.name = addPrefix(node.name);
return;
}

// .class
if (node.type === 'ClassSelector' && node.name) {
node.name = node.name.split(' ').map(addPrefix).join(' ');
return;
}

// url(...) in value
if (node.type === 'Url' &&
node.value.value && node.value.value.length > 0) {
Expand Down

0 comments on commit 50fe6b4

Please sign in to comment.