minor style tweaks

pull/10432/head
Rich Harris 3 years ago
parent cd3bac9e5c
commit fac05f3a07

@ -8,7 +8,7 @@ import { push_array } from '../utils/push_array.js';
import { create_attribute } from '../../nodes.js';
const regex_css_browser_prefix = /^-((webkit)|(moz)|(o)|(ms))-/;
const regex_name_sequence = /^[\s,;}]$/;
const regex_name_boundary = /^[\s,;}]$/;
/**
* @param {string} name
* @returns {string}
@ -217,16 +217,23 @@ class Declaration {
let name = '';
while (index < code.original.length) {
const current = code.original[index];
const character = code.original[index];
if (regex_name_sequence.test(current)) {
if (name && keyframes.has(name))
code.update(index - name.length, index, /**@type {string}*/ (keyframes.get(name)));
if (regex_name_boundary.test(character)) {
const keyframe = keyframes.get(name);
if (current === ';' || current === '}') break;
if (keyframe) {
code.update(index - name.length, index, keyframe);
}
if (character === ';' || character === '}') {
break;
}
name = '';
} else name += current;
} else {
name += character;
}
index++;
}

@ -16,6 +16,7 @@
transform: scale(2);
}
}
h1.svelte-xyz {
animation: 1s linear infinite svelte-xyz-a;
animation: svelte-xyz-a 1s linear infinite;

@ -18,6 +18,7 @@
transform: scale(2);
}
}
h1 {
animation: 1s linear infinite a;
animation: a 1s linear infinite;

Loading…
Cancel
Save