Merge pull request #1310 from sveltejs/gh-1300

bail out of CSS optimisations on encountering spread
pull/1311/head
Rich Harris 7 years ago committed by GitHub
commit 8717ff8c3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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