use bindings when matching attribute selector against element (#3281)

pull/3335/head
Conduitry 5 years ago
parent 981f30d3e9
commit 45a54c1aa4

@ -219,6 +219,8 @@ function attribute_matches(node: Node, name: string, expected_value: string, ope
const spread = node.attributes.find(attr => attr.type === 'Spread');
if (spread) return true;
if (node.bindings.some((binding: Node) => binding.name === name)) return true;
const attr = node.attributes.find((attr: Node) => attr.name === name);
if (!attr) return false;
if (attr.is_true) return operator === null;

@ -0,0 +1 @@
details[open].svelte-xyz{color:red}

@ -0,0 +1,11 @@
<script>
let open = false;
</script>
<details bind:open>Hello</details>
<style>
details[open] {
color: red;
}
</style>
Loading…
Cancel
Save