Skip to content

Each first nested css rule isn't highlighted properly #40

Open

Description

Type: Bug

  1. Create a css file
  2. Add a rule
  3. Nest a few rules inside

Example:

.useful-class {
    .rule-without-highlight {
        background-color: red;
    }

    .rule-with-highlight {
        background-color: green;
    }

    .another-rule-with-highlight {
        background-color: green;
    }
}

useful-selector {
    selector-without-highlight {
        background-color: red;
    }

    selector-with-highlight {
        background-color: green;
    }

    another-selector-with-highlight {
        background-color: green;
    }
}

:first {
    :first-child {
        background-color: red;
    }

    :nth-child(2) {
        background-color: green;
    }

    :last-child {
        background-color: green;
    }
}

Example output:

Image


VS Code version: Code - Insiders 1.98.0-insider (21525b01bf68bf9250cb856f192628fffc449234, 2025-02-11T05:04:43.535Z)
OS version:
Modes:

System Info: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0

Extensions (16)

Extension Author (truncated) Version
anycode-kotlin ms- 0.0.5
anycode ms- 0.0.73
anycode-python ms- 0.0.5
anycode-java ms- 0.0.5
anycode-cpp ms- 0.0.5
anycode-typescript ms- 0.0.5
anycode-go ms- 0.0.5
anycode-c-sharp ms- 0.0.5
anycode-php ms- 0.0.6
anycode-rust ms- 0.0.6
remotehub Git 0.65.2024112101
remote-explorer ms- 0.5.2025010909
remote-repositories ms- 0.43.2024112101
codespaces Git 1.17.3
remote-server ms- 1.6.2025010809
azure-repos ms- 0.41.2024112101

Activity

  1. changed the title [-]Each first nested rule isn't highlighted properly[/-] [+]Each first nested css rule isn't highlighted properly[/+] on Feb 11, 2025
  2. jacobcassidy commented on Jun 2, 2025

    @jacobcassidy
    Contributor

    VSCode doesn't currently support nested CSS. PR #30 will fix this issue.

  3. thernstig commented on Oct 13, 2025

    @thernstig

    Close this in favor of #9?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions