webcomponents / webcomponents/polyfills

[ShadyCSS] Integration with Lit/HyperHtml - Dynamic Class Interpolation

Open
#18 3 comments 0 reactions 0 assignees View on GitHub
Package: shadycss Severity: Medium Type: Feature wontfix
Dominant language
HTML
Stars
1.2k
Forks
168
PR merge metrics
No merged PRs in 30d

Description

We discovered an issue today in our application where we use `hyperHtml` and `shadyCss` extensively and successfully. We used a variable that *changes dynamically* over time to apply a class to a dom Element. When the class is updated, ShadyCSS styles are unfortunately cleared off.

My question here is - how do i force shadyCSS to re-apply styles to an element it thinks it has styled? I have tried the suspects - `styleElement`, `styleSubtree` and `styleDocument` but I believe there has to be some mechanism preventing shadyCSS from restyling certain elements. Any ideas what we could do better or differently here?

Our current workaround is not to use hyperHtml interpolation to set classes in the instance we discovered it, but we are wondering how this can be handled on a larger scale

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.