mirror of https://github.com/sveltejs/svelte
The set of attributes whose values are matched case-insensitively did not match the spec section its own comment links to. Attributes such as lang, media and hreflang were missing, so selectors that a browser applies were pruned as unused and the scoping class was never added.pull/18779/head
parent
5895c637b0
commit
e67f61026c
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: align CSS attribute selector case-sensitivity with the HTML spec
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
warnings: [
|
||||||
|
{
|
||||||
|
filename: 'SvelteComponent.svelte',
|
||||||
|
code: 'css_unused_selector',
|
||||||
|
message: 'Unused CSS selector "input[autocomplete="on"]"',
|
||||||
|
start: {
|
||||||
|
character: 178,
|
||||||
|
column: 1,
|
||||||
|
line: 16
|
||||||
|
},
|
||||||
|
end: {
|
||||||
|
character: 202,
|
||||||
|
column: 25,
|
||||||
|
line: 16
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
div[lang="en"].svelte-xyz {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
a[hreflang="en"].svelte-xyz {
|
||||||
|
color: blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (unused) input[autocomplete="on"] {
|
||||||
|
color: green;
|
||||||
|
}*/
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<div class="svelte-xyz" lang="EN">Hello</div> <a class="svelte-xyz" hreflang="EN" href="/">World</a> <input autocomplete="ON" />
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
<div lang="EN">Hello</div>
|
||||||
|
|
||||||
|
<a hreflang="EN" href="/">World</a>
|
||||||
|
|
||||||
|
<input autocomplete="ON" />
|
||||||
|
|
||||||
|
<style>
|
||||||
|
div[lang="en"] {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
a[hreflang="en"] {
|
||||||
|
color: blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[autocomplete="on"] {
|
||||||
|
color: green;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in new issue