Merge pull request #906 from m59peacemaker/css-attribute-name-only-bug

Fixes #905 css attribute name only bug
pull/912/head
Rich Harris 7 years ago committed by GitHub
commit fee5754c32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -224,6 +224,7 @@ function attributeMatches(node: Node, name: string, expectedValue: string, opera
if (!attr) return false;
if (attr.value === true) return operator === null;
if (attr.value.length > 1) return true;
if (!expectedValue) return true;
const pattern = operators[operator](expectedValue, caseInsensitive ? 'i' : '');
const value = attr.value[0];

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

@ -0,0 +1 @@
[foo][svelte-xyz]{color:red}[baz][svelte-xyz]{color:blue}

@ -0,0 +1,11 @@
<div foo='bar'></div>
<div baz></div>
<style>
[foo] {
color: red;
}
[baz] {
color: blue;
}
</style>
Loading…
Cancel
Save