Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 5eaab46

Browse files
committed
fix(sheet.ts): Fixed to Include pseudo classes and elements
1 parent 3cfa575 commit 5eaab46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/method/sheet.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export function sheet<T extends ClassesObjectType>(object: ExactClassesObjectTyp
1313
get: function (target, prop: string) {
1414
if (typeof prop === 'string' && prop in target) {
1515
const className = prop + '_' + base62Hash;
16-
const mediaBlockRegex = new RegExp(`(?:\\@media[^{]+\\{[\\s\\S]*?\\.${className}\\s*\\{[\\s\\S]*?\\})`, 'g');
17-
const classRuleRegex = new RegExp(`\\n\\.${className}\\s*\\{[\\s\\S]*?\\}`, 'g');
16+
const mediaBlockRegex = new RegExp(`(?:\\@media[^{]+\\{[\\s\\S]*?\\.${className}(?:\\s|\\S)*?\\{[\\s\\S]*?\\})`, 'g');
17+
const classRuleRegex = new RegExp(`\\n\\.${className}(?:\\s|\\S)*?\\{[\\s\\S]*?\\}`, 'g');
1818
const sheet = (Array.from(styleSheet.match(mediaBlockRegex) || []) as string[])
1919
.concat(Array.from(styleSheet.match(classRuleRegex) || []) as string[])
2020
.join('');

0 commit comments

Comments
 (0)