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

:not selector doesn't work with class-directive #14169

Closed
sockmaster27 opened this issue Nov 5, 2024 · 3 comments
Closed

:not selector doesn't work with class-directive #14169

sockmaster27 opened this issue Nov 5, 2024 · 3 comments

Comments

@sockmaster27
Copy link
Contributor

Describe the bug

For the following Svelte component I would expect that the h1 element would be styled with a red background:

<script>
	const x = false;
</script>

<h1 class:x>Hello, world!</h1>

<style>
	h1:not(.x) {
		background-color: red;
	}
</style>

Instead, no background color is applied to the element and a warning is produced:
Unused CSS selector "h1:not(.x)"

Reproduction

https://svelte.dev/playground/7e9220bafc094e209bb9a53e7e7bb48d?version=5.1.10

Logs

No response

System Info

N/A

Severity

annoyance

@Rich-Harris
Copy link
Member

I came to the issue tracker to report the same thing — this works in 5.1.9, not in 5.1.10. It broke in #13999

@Conduitry
Copy link
Member

See also #14168, another thing that was broken.

See also also #14166, something that (I think?) was fixed.

@Rich-Harris
Copy link
Member

closing as dupe of #14168

@Rich-Harris Rich-Harris closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2024
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

3 participants