-
Notifications
You must be signed in to change notification settings - Fork 359
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
trying ignore mixed-decls
warning but still got these warning in Vite(5.3.1
).
#2280
Comments
The deprecations options are only available in the modern JS API. Vite is still using the legacy JS API, so you'll need to wait until vitejs/vite#7116 is resolved to use these flags. |
Hi, @daiwanxing you can try this: *vite.config.js
|
Thank you, this is a good workaround! |
Finally a workaround, I wish this was clear in the documentation that scss support is not up to date and so preprocessorOptions wont work as expected. |
…77.7 + see: https://sass-lang.com/documentation/breaking-changes/mixed-decls/#example-mixed-declarations-opt-in-scss warning report: ```shell Deprecation Warning: Sass's behavior for declarations that appear after nested rules will be changing to match the behavior specified by CSS in an upcoming version. To keep the existing behavior, move the declaration above the nested rule. To opt into the new behavior, wrap the declaration in `& {}`. More info: https://sass-lang.com/d/mixed-decls ╷ 47 │ ┌ &.#{$css-prefix}formily-item-warning-help { 48 │ │ color: $form-warning-color; 49 │ │ } │ └─── nested rule ... │ 54 │ top: 100%; │ ^^^^^^^^^ declaration ╵ stdin 54:11 root stylesheet ``` ## issues - sass/dart-sass#2280 - vitejs/vite#7116
You have to use at leaset the "modern" API: export default defineConfig({
css: {
preprocessorOptions: {
scss: {
api: 'modern',
silenceDeprecations: ['mixed-decls'],
},
}
}
} See also Shared Options | Vite. |
that works! thank u |
Hi, this is only indirectly related to I get a lot of Here's an example:
In the example given in the documentation, the Anyway I think Sass is warning about an upcoming change to the lexical order of generated CSS, but on code blocks where lexical order won't affect the browser's computed ruleset. And if that's right, then IMO the current warning scope is a bug, especially since there's no usage that's actually going away... nested blocks and top-level declarations will of course continue to coexist. FWIW I don't think I'm retreading #2276, because I think the warning is a good idea. But the false alarms might encourage people to silence the alarm... and sure nuff, a decent chunk of the doc page for the mixed-decls change is about how to silence warnings. |
@johncip Make a new issue for visibility, you've pinged contributors in here for a related but different issue and unlikely maintainer is going to read messages in closed threads. Good luck |
@johncip It's more complex than it looks to only warn for rules that are known to have the same specificity—it means we have to compare the parent rule against all previous rules in the current context rather than just checking whether at least one such rule exists. But I agree it would substantially reduce false positives, so I plan to look into it next week to see how feasible an implementation would be. |
@nex3 devil is in the details, I should have known :D I didn't mention it earlier but I was picturing shorthands as a pain point... thank you for taking the time to look into it! |
Seems like a useful approach... upgrading got rid of all of my false positives, thank you! |
just now upgrade my dependency of sass to the latest version (
1.77.8
) and restart, the app terminal output some warnings that i've never got.I have no time to solve these warnings, the easily way to me is make these warnings keep silence.
I followed the document instructions. but it's not work, I still got bunch of warnings. Is there something wrong with my configuration?
The text was updated successfully, but these errors were encountered: