runem / lit-analyzer

Monorepository for tools that analyze lit-html templates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[vscode-lit-plugin] Non-hex color formats aren't recognized for color picker

au5ton opened this issue · comments

Related to #30

Currently, the only colors that can be matched and that can use the color picker are hex based:

const colorMatches = getRegexMatches(COLOR_HEX_REGEX, taggedTemplateText);

With an HTML file:
image

With a TS file:
image

Reproduce:

import { LitElement, css, html } from 'lit'
import { customElement } from 'lit/decorators.js'

@customElement('foo-element')
export class FooElement extends LitElement {
  render() {
    return html`<p>hello</p>`;
  }

  static styles = css`
    .foo {
      background: white;
      background-color: rgb(234, 238, 242);
      color: hsl(120deg, 75%, 25%);
      color: hsla(120deg, 75%, 25%, 0.5);
      color: #fff;
    }
  `
}