bail out of CSS optimisations on encountering spread - fixes #1300

pull/1310/head
Rich-Harris 6 years ago
parent b4ade9d4b2
commit d6b8ca3fdb

@ -223,6 +223,9 @@ const operators = {
};
function attributeMatches(node: Node, name: string, expectedValue: string, operator: string, caseInsensitive: boolean) {
const spread = node.attributes.find(attr => attr.type === 'Spread');
if (spread) return true;
const attr = node.attributes.find((attr: Node) => attr.name === name);
if (!attr) return false;
if (attr.value === true) return operator === null;

@ -0,0 +1,3 @@
export default {
cascade: false
};

@ -0,0 +1 @@
.foo.svelte-xyz{color:red;font-size:2em;font-family:'Comic Sans MS'}

@ -0,0 +1,11 @@
<div {{...props}} >
Big red Comic Sans
</div>
<style>
.foo {
color: red;
font-size: 2em;
font-family: 'Comic Sans MS';
}
</style>
Loading…
Cancel
Save