I've also ran into this issue while utilizing nesting. Because nesting is not officially apart of vanilla css VS code is automatically spitting out errors. The best way to fix this issue is to install the VS Code plugin https://marketplace.visualstudio.com/items?itemName=csstools.postcss. this will fix up those nasty little errors. Let me know if that helps you out.
Answer from yanir midler on Stack OverflowVideos
I've been hoping someone would add CSS Nesting to VSCode, either natively or through an extension. I finally decided to do it myself and published the free extension, called CSS Nesting Syntax Highlighting, in the official VSCode marketplace.
CSS nesting has been available in all major browsers since last year, so I'm surprised it hasn't been created before this. Now is a great time to start using CSS nesting if you haven't already.
I also added syntax highlighting for other missing tokens, such as `@container` and `calc()` & `var()` functions for `@rules` in the extension.
I'm trying to set up an scss/css project, using the Web Compiler extension.
The scss is compiling into css nicely, but in the Solution Explorer it's not nesting them so it gets real messy real quick.
Looking at the documentation, I should be able to choose between 'off, 'default' and 'web' with a dropdown in the toolbar at the top. But I don't have that on mine. Is it just some setting I need to set somewhere?
From the documentation:
Mine:
I am looking for a VS Code extension to minify CSS files and support CSS nesting.
Any suggestions?
Notes:
CSS Nesting is available in all browsers now, and there are a few minification plugins, but most of them are outdated.
I don't use npm or postcss, only vanilla CSS.
