Skip to main content
The 2024 Developer Survey results are live! See the results

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • I don't have any custom elements, I am using lit-html by itself, not with lit-element or some equivalent. I am not sure how your code relates to the CSS, are you saying I have to use a callback to this.dragEnter, if so, what would be in that method, how will it refer to the <button>? Cheers!
    – Sumomo
    Commented Jan 23, 2019 at 22:11
  • Updated the answer based on your comment. Commented Jan 24, 2019 at 6:32
  • Thanks for the update, but it is only a partial answer, you did not address the CSS or what the dragEnter() method might contain. I am new to lit-html and the docs are woefully inadequate right now (it is pre-release still). What is best practice? Should my methods mutate the DOM as before? Should I feed in new variables into the template/re-write it with new bindings for class? Run the render() function again after each callback? If you could provide a full solution in code would be great :) Thanks for your time, it is much appreciated!
    – Sumomo
    Commented Jan 24, 2019 at 9:30
  • Added some more clarification Commented Jan 24, 2019 at 19:25
  • Cheers! classMap was what I was looking for, seems made for the job :) Nothing in the docs, but the comments in the source code explain github.com/Polymer/lit-html/blob/master/src/directives/…
    – Sumomo
    Commented Jan 25, 2019 at 17:19