Microsoft/vscode

[scss] selector specificity works wrong with nested selectors

Open

#63,200 opened on Nov 15, 2018

View on GitHub
 (3 comments) (10 reactions) (1 assignee)TypeScript (74,848 stars) (10,221 forks)batch import
bugcss-less-scsshelp wanted

Description

Issue Type: Bug

Css specifity calculator doesn't respect nested selectors or selectors with &.

#id {} /* (1, 0, 0) */

#id div {} /* (1, 0, 1) */
#id {
  div { /* (0, 0, 1) */
  }
}

.block{ /* (0, 1, 0) */
  &__element { /* (0, 0, 0) */
  }
}

Reproduced without any extensions

VS Code version: Code 1.29.0 (5f24c93878bd4bc645a4a17c620e2487b11005f9, 2018-11-12T07:47:15.448Z) OS version: Windows_NT x64 10.0.17134

Contributor guide