CSS highlighting breaks when a nested rule comes before a custom property in the same block
@alexr00 is already working on this.
Since Jul 28, 2026.
- #327821 by @srikanthananthula63053 — closed without merging
Assessment
This issue has not been assessed yet.
Description
Bug
When a CSS block has a nested rule followed by a custom property declaration, syntax highlighting desyncs from that point on.
Repro
#a { .b { gap: 1px; } --c: 1px; }
Swap the order and it highlights fine:
#a { --c: 1px; .b { gap: 1px; } }
Both are valid, equivalent CSS (order doesn't matter per the CSS Nesting spec) — only the highlighting differs.
Expected: both orders highlight the same.
Env: Windows
- Dominant language
- JavaScript
- Stars
- 27
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode-css
-
CSS Bracket colorization error when } is inside of urlPossibly taken @aeschli claimed this 21 days ago. Open
microsoft/vscode-css#66 · 2 comments · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
microsoft/vscode-css#53 · 6 comments · 28 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
microsoft/vscode-css#45 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
microsoft/vscode-css#46 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
microsoft/vscode-css#44 · 1 comment · 5 reactions ·
All issues in microsoft/vscode-css
Similar issues
-
ci-install-db-tools stall-case tests flake: stalled apt-get can be killed before it logs its callOpeneffort:low model:light plan planner:opus-5-5 tests
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Bug 🐞
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mozilla-mobile/firefox-ios#35986 ·
Maintainers usually reply within 1 day
-
component:sight
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agentic-os-org/ANOLISA#6738 · 2 comments ·
Maintainers usually reply within 1 day
-
bug Durable Agents Observability (AI Telemetry) status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
mastra-ai/mastra#26470 · 1 comment ·
Maintainers usually reply within 1 day
-
feature/cohorts feature/feature-flags team/feature-flags
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day