lit-analyzer icon indicating copy to clipboard operation
lit-analyzer copied to clipboard

vscode-lit-plugin ignores `css.customData`

Open jimbojw opened this issue 1 year ago • 0 comments

According to the vscode-css-languageservice documentation, it supports configuration via the css.customData setting.

However, the vscode-lit-plugin does not appear to honor these settings when analyzing css templates. For example, it should be possible to define a custom @ rule, like so:

.vscode/settings.json:

{
  "css.customData": ["./.vscode/css-data.json"]
}

.vscode/css-data.json (attempting to work around #323):

{
  "version": 1.1,
  "atDirectives": [
    {
      "name": "@container",
      "description": "https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries"
    }
  ]
}

Example TypeScript code:

import { css } from "lit";

export const EXAMPLE_CSS = css `
  @container (width < 600px) {
    /* ... */
  }
`;

Expected: No warnings.

Actual: Problems view reads Unknown at rule @container lit-plugin(no-invalid-css).

jimbojw avatar Oct 13 '24 18:10 jimbojw