mirror of https://github.com/sveltejs/svelte
Merge 8d67a09957 into d16099ef0f
commit
419bcca9ce
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: accept a negative `a` in `:nth-child(an+b)` and an uppercase `n`
|
||||
@ -0,0 +1,17 @@
|
||||
|
||||
/* the `a` of `an+b`, and a lone `<integer>`, can be negative, and `n` is case-insensitive */
|
||||
li.svelte-xyz:nth-child(-1) {
|
||||
color: red;
|
||||
}
|
||||
li.svelte-xyz:nth-child(-2n) {
|
||||
color: green;
|
||||
}
|
||||
li.svelte-xyz:nth-child(-2n-1) {
|
||||
color: blue;
|
||||
}
|
||||
li.svelte-xyz:nth-child(2N+1) {
|
||||
color: yellow;
|
||||
}
|
||||
li.svelte-xyz:nth-child(-2n-1 of .important) {
|
||||
color: purple;
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
<ul>
|
||||
<li>a</li>
|
||||
<li class="important">b</li>
|
||||
</ul>
|
||||
|
||||
<style>
|
||||
/* the `a` of `an+b`, and a lone `<integer>`, can be negative, and `n` is case-insensitive */
|
||||
li:nth-child(-1) {
|
||||
color: red;
|
||||
}
|
||||
li:nth-child(-2n) {
|
||||
color: green;
|
||||
}
|
||||
li:nth-child(-2n-1) {
|
||||
color: blue;
|
||||
}
|
||||
li:nth-child(2N+1) {
|
||||
color: yellow;
|
||||
}
|
||||
li:nth-child(-2n-1 of .important) {
|
||||
color: purple;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in new issue