Skip to content

Commit 8bb99d1

Browse files
committed
fix: camel case css class name missing
close #1447
1 parent 635898b commit 8bb99d1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/vue-typescript/src/utils/parseCssClassNames.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { clearComments } from './parseCssVars';
22

3-
// https://gist.github.com/Potherca/f2a65491e63338659c3a0d2b07eee382
43
export function* parseCssClassNames(styleContent: string) {
54
styleContent = clearComments(styleContent);
6-
const reg = /\.[a-z]([a-z0-9-]+)?(__([a-z0-9]+-?)+)?(--([a-z0-9]+-?)+){0,2}/g;
7-
const matchs = styleContent.matchAll(reg);
5+
const cssClassNameRegex = /\.([\w-]+)/g;
6+
const matchs = styleContent.matchAll(cssClassNameRegex);
87
for (const match of matchs) {
98
if (match.index !== undefined) {
109
const matchText = match[0];

0 commit comments

Comments
 (0)