mirror of https://github.com/sveltejs/svelte
				
				
				
			fix: allow combinator at start of nested CSS selector (#13440)
	
		
	
				
					
				
			* fix: allow combinator at start of nested CSS selector Solved by moving the combinator positioning validation into the analysis phase Fixes #13433 * highlight the combinator, not the start of the combinator * fix --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/13486/head
							parent
							
								
									d77905d788
								
							
						
					
					
						commit
						5675067e2b
					
				@ -0,0 +1,5 @@
 | 
				
			|||||||
 | 
					---
 | 
				
			||||||
 | 
					'svelte': patch
 | 
				
			||||||
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					fix: allow combinator at start of nested CSS selector
 | 
				
			||||||
@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					import { test } from '../../test';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export default test({
 | 
				
			||||||
 | 
						warnings: [
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								code: 'css_unused_selector',
 | 
				
			||||||
 | 
								end: {
 | 
				
			||||||
 | 
									character: 109,
 | 
				
			||||||
 | 
									column: 11,
 | 
				
			||||||
 | 
									line: 11
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								message: 'Unused CSS selector "~ .unused"',
 | 
				
			||||||
 | 
								start: {
 | 
				
			||||||
 | 
									character: 100,
 | 
				
			||||||
 | 
									column: 2,
 | 
				
			||||||
 | 
									line: 11
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						]
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
@ -0,0 +1,10 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
						.foo.svelte-xyz {
 | 
				
			||||||
 | 
							> .bar:where(.svelte-xyz) {
 | 
				
			||||||
 | 
								color: red;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							/* (unused) ~ .unused {
 | 
				
			||||||
 | 
								color: red;
 | 
				
			||||||
 | 
							}*/
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					<div class="foo">
 | 
				
			||||||
 | 
						<div class="bar"></div>
 | 
				
			||||||
 | 
					</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<style>
 | 
				
			||||||
 | 
						.foo {
 | 
				
			||||||
 | 
							> .bar {
 | 
				
			||||||
 | 
								color: red;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							~ .unused {
 | 
				
			||||||
 | 
								color: red;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue