Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS next-sibling combinator doesn't work if template is inside snippet #15487

Open
mary-ext opened this issue Mar 10, 2025 · 0 comments
Open

Comments

@mary-ext
Copy link

mary-ext commented Mar 10, 2025

Describe the bug

using CSS next-sibling combinator .a + .b doesn't work as Svelte considers it unused when the template is inside a snippet.

Reproduction

Playground link

{@render Thing("foo")}
{@render Thing("bar")}

{#snippet Thing(label)}
	<div class="thing">{label}</div>
{/snippet}

<style>
	.thing {
		& + & {
			color: red;
		}
	}

	.thing + .thing {
		color: red;
	}
</style>

The second <div.thing> is expected to have a red text color.

Logs

Not applicable.

System Info

Not applicable, playground link provided.

Severity

annoyance

@mary-ext mary-ext changed the title CSS next-sibling combinator doesn't work if used with snippets CSS next-sibling combinator doesn't work if template is inside snippet Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant