Skip to content

Commit

Permalink
fix(preset-mini): don't generate arbitrary property if it starts with…
Browse files Browse the repository at this point in the history
… colon (#2117)
  • Loading branch information
sibbng committed Jan 27, 2023
1 parent c5b548c commit 8d7e876
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/preset-mini/src/_rules/variables.ts
Expand Up @@ -26,7 +26,7 @@ export const cssVariables: Rule[] = [
]

export const cssProperty: Rule[] = [
[/^\[(--(\w|\\\W)+|[\w-]+):(.+)\]$/, ([match, prop,, value]) => {
[/^\[(--(\w|\\\W)+|[\w-]+):([^:].*)\]$/, ([match, prop,, value]) => {
if (!isURI(match.slice(1, -1)))
return { [prop]: h.bracket(`[${value}]`) }
}],
Expand Down
1 change: 1 addition & 0 deletions test/assets/preset-mini-targets.ts
Expand Up @@ -1067,6 +1067,7 @@ export const presetMiniNonTargets = [
'[name].[hash:9]',
'["update:modelValue"]',
'[https://en.wikipedia.org/wiki]',
'[Baz::class]',
// escaped arbitrary css properties only allowed in css variables
'[cant\~escape:me]',
]

0 comments on commit 8d7e876

Please sign in to comment.