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 Overflow
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
CSS Nesting Syntax Highlighting - Visual Studio Marketplace
Extension for Visual Studio Code - Updates VSCode's CSS TextMate rules to add CSS Nesting
🌐
GitHub
github.com › microsoft › vscode › issues › 147824
[css] Add support for CSS nesting (experimental) · Issue #147824 · microsoft/vscode
April 21, 2022 - It is already possible today to use CSS nesting based on the working draft with PostCSS and the PostCSS Nesting plugin. Unfortunately doing so throws a whole bunch of errors: css-rcurlyexpected, css-lcurlyexpected, css-selectorexpected, ...
Author   Th3S4mur41
🌐
Reddit
reddit.com › r/vscode › psa: css nesting syntax highlighting extension for vscode is now available
r/vscode on Reddit: PSA: CSS Nesting Syntax Highlighting extension for VSCode is now available
January 24, 2024 -

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.

🌐
Developer Community
developercommunity.visualstudio.com › t › CSS-Editor-in-Visual-Studio-needs-suppor › 10577079
CSS Editor in Visual Studio needs support for CSS nesting
February 3, 2024 - Visual Studio · Visual Studio · Visual Studio · Sign in · Sorry this browser is no longer supported ·
🌐
Reddit
reddit.com › r/visualstudio › why don't i have nesting options in vs2022?
r/VisualStudio on Reddit: Why don't I have nesting options in VS2022?
May 31, 2023 -

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:

🌐
GitHub
github.com › wprig › wprig › issues › 716
CSS nesting produces errors · Issue #716 · wprig/wprig
May 17, 2021 - CSS nesting produces errors#716 · Copy link · Assignees · Labels · Hacktoberfestgood first issueGood for newcomersGood for newcomers · erdmann040 · opened · on May 17, 2021 · Issue body actions · Not realy a bug in wp-rig itself but in the recommended configuration of visual studio code: If I use nested selectors, like here: div.myclass { color: #000; & a { color: #f0f; } } the following errors are reported (see screenshot below): } expected css(css-rcurlyexpected) at-rule or selector expected css(css-ruleorselectorexpected), This should work out of the box, shouldn't it?
Published   May 17, 2021
Author   erdmann040
Find elsewhere
🌐
Stack Overflow
stackoverflow.com › questions › 31920391 › visual-studio-nesting-html-css-and-ts-files
Visual Studio Nesting html,css and ts files - Stack Overflow
May 25, 2023 - P.S. This is my first post in this forum so I'm not able to upload an image else I would have shared a screen shot of the project with you guys for better understanding of my problem. ... Nesting is done through the VS project file.
🌐
GitHub
github.com › jacobcassidy › vscode-css-nesting-syntax-highlighting
GitHub - jacobcassidy/vscode-css-nesting-syntax-highlighting: A Visual Studio Code extension that adds syntax highlighting in the editor for CSS nesting.
The core CSS syntax file this extension updates can be found in the official vscode repo. .example { text-decoration: none; &:hover { text-decoration: underline; } } /* The browser parses this as: */ .example { text-decoration: none; } .example:hover { text-decoration: underline; } /* Nested @container example */ @container summary (width > 400px) { @container (min-width: 800px) { .card { margin: 50px; } @container (min-width: calc( var(--width) * 1rem)) { .card { margin: 0; } } }
Author   jacobcassidy
🌐
GitHub
github.com › microsoft › vscode-css › issues › 9
Add support for nested CSS · Issue #9 · microsoft/vscode-css
May 29, 2023 - At this time nested CSS is not support because at rule and selector patterns aren't included in rules. specification : https://drafts.csswg.org/css-nesting/ wpt : https://wpt.fyi/results/css/css-ne...
Published   May 29, 2023
Author   romainmenke
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
PostCSS Language Support - Visual Studio Marketplace
Extension for Visual Studio Code - Syntax highlighting for modern and experimental CSS in VSCode
🌐
Microsoft Learn
learn.microsoft.com › en-us › visualstudio › ide › file-nesting-solution-explorer
File nesting rules for Solution Explorer - Visual Studio (Windows) | Microsoft Learn
June 6, 2025 - Discover Solution Explorer in Visual Studio and review how to work with file nesting rules, presets, and customization for project-specific settings.
🌐
GitHub
github.com › Microsoft › vscode › issues › 3907
CSSnext & preCSS Support · Issue #3907 · microsoft/vscode
February 3, 2024 - Please add CSSnext & preCSS Support When using cssnext in combination with precss a lot of warning are given concerning expected braces or semicolons when nesting. This leads to a lot of red stripes and color theme being completely off. ...
Author   DenisValcke
🌐
GitHub
github.com › microsoft › vscode › issues › 200314
Nested elements in CSS · Issue #200314 · microsoft/vscode
December 8, 2023 - Type: Adding Feature In the CSS3 features released in 2023, the inclusion of nested elements is noteworthy. However, it is observed that Visual Studio Code does not currently comprehend nesting. I anticipate the incorporation of coloriza...
Author   ghost
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
PostCSS syntax - Visual Studio Marketplace
August 10, 2015 - Extension for Visual Studio Code - PostCSS language support
🌐
GitHub
github.com › aspnet › Tooling › issues › 347
File nesting in Solution Explorer is inconsistent and incorrect · Issue #347 · aspnet/Tooling
November 14, 2015 - The .less and .scss files should be nested under .html. Those files compile to .css just like .ts compile to .js and they are just as much part of the view component.
Author   thomas-darling
🌐
Developer Community
developercommunity.visualstudio.com › t › The-CSS-Nesting-selector-description-cau › 10609843
The CSS Nesting selector description causes an error in ...
March 23, 2024 - Visual Studio · Visual Studio · Visual Studio · Sign in · Sorry this browser is no longer supported ·