-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
svelte-windicss-preprocess/src/utils.ts
Lines 129 to 146 in c0b5f5c
| processAttributify() { | |
| // TODO: ERROR HANDLING | |
| // TODO: Debug utils lib | |
| // FIXME: #150 not bulletprof yet | |
| const tmpContent = this.content | |
| const ATTRIBUTIFY_CLASS_MATCHES = [...tmpContent.matchAll(/([\w+:_/-]+)=(['"])([!\w\s\n~:/\\,%#[\].$-]*?)\2/gi)] | |
| // TODO: allow prefix with :: | |
| // extract key & value as class array | |
| if (ATTRIBUTIFY_CLASS_MATCHES.length < 1) return this | |
| for (const match of ATTRIBUTIFY_CLASS_MATCHES) { | |
| if (match[1] == 'class') continue | |
| this.attributifyClassList.set(match[1].toString(), match[3].split(' ')) | |
| } | |
| this.content = tmpContent | |
| return this | |
| } |
Metadata
Metadata
Assignees
Labels
No labels