summaryrefslogtreecommitdiff
path: root/src/compiler/optimize/postcss-scoped-styles/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/optimize/postcss-scoped-styles/index.ts')
-rw-r--r--src/compiler/optimize/postcss-scoped-styles/index.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler/optimize/postcss-scoped-styles/index.ts b/src/compiler/optimize/postcss-scoped-styles/index.ts
index 7949f63b5..a4afd99aa 100644
--- a/src/compiler/optimize/postcss-scoped-styles/index.ts
+++ b/src/compiler/optimize/postcss-scoped-styles/index.ts
@@ -50,7 +50,13 @@ export function scopeSelectors(selector: string, className: string) {
// leave :global() alone!
if (value.startsWith(':global(')) {
- ss = head + ss.substring(start, end).replace(':global(', '').replace(')', '') + tail;
+ ss =
+ head +
+ ss
+ .substring(start, end)
+ .replace(/^:global\(/, '')
+ .replace(/\)$/, '') +
+ tail;
continue;
}