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

Svelte is not detecting used classes. #10440

Closed
ievgennaida opened this issue Feb 9, 2024 · 3 comments
Closed

Svelte is not detecting used classes. #10440

ievgennaida opened this issue Feb 9, 2024 · 3 comments
Labels
awaiting submitter needs a reproduction, or clarification

Comments

@ievgennaida
Copy link

ievgennaida commented Feb 9, 2024

Describe the bug

I have a button from one of the svelte frameworks that has class.
Svelte is not detecting properly that style is used.
-> Unused CSS selector ".upload-button"svelte(css-unused-selector)

Using class on a div will resolve an issue! Only custom properties are failing!

"svelte": "4.2.10",
"svelte-check": "3.6.3",

Reproduction

<style> .upload-button { width: 130px; display: inline-block; } </style>

Logs

Unused CSS selector ".upload-button"svelte(css-unused-selector)

System Info

  Windows
    "svelte": "4.2.10",
    "svelte-check": "3.6.3",

Severity

blocking all usage of svelte

@Prinzhorn
Copy link
Contributor

Can you please provide actual steps to reproduce? Preferably as REPL. My guess is that you are using a component that has a class prop, which would be a duplicate of:

https://github.com/search?q=repo%3Asveltejs%2Fsvelte+class+prop+css-unused-selector&type=issues

#7763
#2870
#8345

@dummdidumm dummdidumm added the awaiting submitter needs a reproduction, or clarification label Feb 9, 2024
@ievgennaida
Copy link
Author

Can you please provide actual steps to reproduce? Preferably as REPL. My guess is that you are using a component that has a class prop, which would be a duplicate of:

https://github.com/search?q=repo%3Asveltejs%2Fsvelte+class+prop+css-unused-selector&type=issues

#7763
#2870
#8345

In one of the answers an awful solution is mentioned with some hacky language and extra wrappings to accomplish basic things. Any reason why this check cannot work or be a flag for the compiler to understand components props?

@Rich-Harris
Copy link
Member

no repro = close issue

@Rich-Harris Rich-Harris closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting submitter needs a reproduction, or clarification
Projects
None yet
Development

No branches or pull requests

4 participants