Merge pull request #3335 from Conduitry/gh-3281

use bindings when matching attribute selector against element
pull/3342/head
Rich Harris 5 years ago committed by GitHub
commit aa1b38ad34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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