|
@@ -24,13 +24,16 @@ const LocalIdentNameplugin = postcss.plugin('LocalIdentNameplugin', ({ localIden
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
// 删除 :global(className) 保留 className
|
|
// 删除 :global(className) 保留 className
|
|
|
- if (item.selector && !item.selector.includes('(')) {
|
|
|
|
|
|
|
+ if (item.selector) {
|
|
|
if (item.selector.includes(':global(')) {
|
|
if (item.selector.includes(':global(')) {
|
|
|
// converted :global(.className)
|
|
// converted :global(.className)
|
|
|
const className = item.selector.match(/:global\((\S*)\)/)[1];
|
|
const className = item.selector.match(/:global\((\S*)\)/)[1];
|
|
|
item.selector = className;
|
|
item.selector = className;
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (item.selector.includes('(')) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
const className = item.selector.replace(/\./g, `.${localIdentName}`);
|
|
const className = item.selector.replace(/\./g, `.${localIdentName}`);
|
|
|
item.selector = className;
|
|
item.selector = className;
|
|
|
}
|
|
}
|