-
Notifications
You must be signed in to change notification settings - Fork 77
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
saving referenced inline styles results in weird x's #65
Comments
I have the same problem after update to last version od vsc and lit-html, any news? <div class="card" style="display:${this.showMenu ? '' : 'none'};">
<!-- change to this when use VSC format document -->
<div class="card" style="display: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;"> Test on lit-html 1.11.0 & 1.10.0 and get same result. But I notice that this problem is not on all my files but I can't find the rules! |
+1. This also happens when the attribute interpolation has surrounding quotes: return html`${this._style()}<div class="container" style="${"abc:1"}"></div>`; After VSC Format: return html`${this._style()}<div class="container" style="xxxxxxxxxx"></div>`; Tested on lit-html extension 1.11.0 with VS Code 1.34.0. |
I had found a solution to our problem but I forget to comment here! Just we must respect lit-HTML bind properties to child elements that describe here! In all example above, we must add a leading dot e.g. <div .style="display:${this.showMenu ? '' : 'none'}; >" or add leading question mark if we have boolean attributes e.g. `<dialog ?open=${this.dialogOpen} > So I think this issue can be closed now! |
@OmidHekayati interesting work around, but not the solution. It is not acceptable for the "Format Document" command to garble syntactically-valid source.
|
Dear @davidnx please send a real code due to your first example
<div .style="display:${this.showMenu ? '' : 'none'};" >
<div style="display: ;" >
<div style="" >
|
Adding |
With the below code snippet, when I try save the file in VS Code it changes ${appleStyles} to a bunch of x's
The text was updated successfully, but these errors were encountered: