diff --git a/src/css/Selector.ts b/src/css/Selector.ts index fba0386f1f82..b1932adba983 100644 --- a/src/css/Selector.ts +++ b/src/css/Selector.ts @@ -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; diff --git a/test/css/samples/spread/_config.js b/test/css/samples/spread/_config.js new file mode 100644 index 000000000000..b37866f9b61a --- /dev/null +++ b/test/css/samples/spread/_config.js @@ -0,0 +1,3 @@ +export default { + cascade: false +}; \ No newline at end of file diff --git a/test/css/samples/spread/expected.css b/test/css/samples/spread/expected.css new file mode 100644 index 000000000000..dc433318e8bc --- /dev/null +++ b/test/css/samples/spread/expected.css @@ -0,0 +1 @@ +.foo.svelte-xyz{color:red;font-size:2em;font-family:'Comic Sans MS'} \ No newline at end of file diff --git a/test/css/samples/spread/input.html b/test/css/samples/spread/input.html new file mode 100644 index 000000000000..d55b90a62f00 --- /dev/null +++ b/test/css/samples/spread/input.html @@ -0,0 +1,11 @@ +