Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
au5ton opened this issue Sep 5, 2023 · 1 comment · May be fixed by #320
Open

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

au5ton opened this issue Sep 5, 2023 · 1 comment · May be fixed by #320

Comments

@au5ton
Copy link

au5ton commented Sep 5, 2023

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;
    }
  `
}
@au5ton
Copy link
Author

au5ton commented Sep 5, 2023

au5ton added a commit to au5ton/lit-analyzer that referenced this issue Sep 5, 2023
@au5ton au5ton linked a pull request Sep 5, 2023 that will close this issue
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 a pull request may close this issue.

1 participant