Skip to content

✋ Ignore missing standard properties in contexts with vendor-specific pseudo-elements#303

Merged
aeschli merged 5 commits intomicrosoft:mainfrom
babakks:avoid-unnecessary-vendor-specific-diagnostics
Nov 9, 2022
Merged

✋ Ignore missing standard properties in contexts with vendor-specific pseudo-elements#303
aeschli merged 5 commits intomicrosoft:mainfrom
babakks:avoid-unnecessary-vendor-specific-diagnostics

Conversation

@babakks
Copy link
Contributor

@babakks babakks commented Oct 25, 2022

Fixes microsoft/vscode#164350

@aeschli Sorry that I'm not deeply familiar with CSS language/syntax and its features.

What's done in this PR is that when vendor-specific pseudo-element selectors (e.g., ::-webkit-slider-thumb) are encountered, we'd then avoid emitting linter errors/warnings about missing standard properties.

Take the cases below as examples (also included as test cases). Previously, the linter would ask to also include the standard appearance property. Now, the first two cases are fine.

/* Simple case (fine) */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
}

/* Nested rule sets (fine) */
input[type="range"]::-webkit-slider-thumb {
  color: black;
  & selector {
    -webkit-appearance: none;
  }
}

/* Prefix `-moz-` which is not in the context (error) */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  -moz-appearance: none;
}

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
… pseudo-elements

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
@aeschli aeschli self-requested a review November 2, 2022 14:11
aeschli
aeschli previously approved these changes Nov 2, 2022
@aeschli aeschli added this to the November 2022 milestone Nov 2, 2022
@aeschli aeschli self-assigned this Nov 2, 2022
@aeschli aeschli merged commit 4163eab into microsoft:main Nov 9, 2022
@babakks babakks deleted the avoid-unnecessary-vendor-specific-diagnostics branch November 9, 2022 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[css] refine vendor-specific warnings in vendor-specific rule blocks

3 participants