Open au5ton opened 10 months ago
Related to #30
Currently, the only colors that can be matched and that can use the color picker are hex based: https://github.com/runem/lit-analyzer/blob/9659154904fd2010de3749fc5e904e8c3dfe684b/packages/vscode-lit-plugin/src/color-provider.ts#L117
With an HTML file:
With a TS file:
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; } ` }
I don't know if this is related or not, but this seems to be how VSCode does it:
https://github.com/microsoft/vscode/blob/7ead2078eb2a097119e66bd8272155bcc1580667/src/vs/editor/common/languages/defaultDocumentColorsComputer.ts#L101-L138
Related to #30
Currently, the only colors that can be matched and that can use the color picker are hex based: https://github.com/runem/lit-analyzer/blob/9659154904fd2010de3749fc5e904e8c3dfe684b/packages/vscode-lit-plugin/src/color-provider.ts#L117
With an HTML file:![image](https://github.com/runem/lit-analyzer/assets/4109551/03e1870c-5a40-4fe1-b5bd-d4903a307cd1)
With a TS file:![image](https://github.com/runem/lit-analyzer/assets/4109551/aaf374d7-36ef-47e9-9d74-716310fd9a52)
Reproduce: