given the following code, and the lit-html vscode extension, syntax highlighting doesn't work on the static styles getter
class MyComponent extends LitElement {
// SYNTAX HIGHLIGHTING FAILS
static get styles() {
return css`
* {}
`
}
// SYNTAX HIGHLIGHTING WORKS
render() {
return html`
<style>
* {}
</style>
`
}
}
however it does work in the html template in the render function
how bad, for performance, is opting for the styles in the render function, instead of the static styles getter?
Moving styles into the render function would mean:
${this.foo}
inside it (which is a bad idea if
you want to be performant or if you want to support non native shadow dom
browsers)So I would say it's a bad idea to do this for syntax highlighting.
You can get those by using more/different plugins:
An up to date list you should always find here https://open-wc.org/developing/ide.html#plugins