Skip to content

Commit 4644727

Browse files
committed
fix: use more strict regex for matching css animation rules
1 parent f2fd8b9 commit 4644727

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/stylePlugins/scoped.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ export default postcss.plugin('add-id', (options: any) => (root: Root) => {
5757
if (Object.keys(keyframes).length) {
5858
root.walkDecls(decl => {
5959
// individual animation-name declaration
60-
if (/-?animation-name$/.test(decl.prop)) {
60+
if (/^(-\w+-)?animation-name$/.test(decl.prop)) {
6161
decl.value = decl.value.split(',')
6262
.map(v => keyframes[v.trim()] || v.trim())
6363
.join(',')
6464
}
6565
// shorthand
66-
if (/-?animation$/.test(decl.prop)) {
66+
if (/^(-\w+-)?animation$/.test(decl.prop)) {
6767
decl.value = decl.value.split(',')
6868
.map(v => {
6969
const vals = v.trim().split(/\s+/)

0 commit comments

Comments
 (0)