jcwillox / lovelace-canary

🐤 Adds many useful extensions to lovelace, such as templating secondary info, stacking within a card and more!
MIT License
97 stars 4 forks source link

Canary 0.3.2 removes styles from other elements #15

Closed michaelarnauts closed 3 years ago

michaelarnauts commented 3 years ago

It seems since version 0.3.2, the styles of other cards are removed. I notice this with the https://github.com/custom-cards/button-card for example.

It seems obvious that this is the cause: https://github.com/jcwillox/lovelace-canary/commit/20f145ed610b76f7c21d8e247aaf3084d76d6df8

jcwillox commented 3 years ago

Yeah, this is semi-intended, I now override the cssText option, before I was setting the actual properties, but that had issues, for example margin-right wouldn't work it needed to be marginRight and CSS variables wouldn't work e,g. --paper-color: red. So this is definitely a better method, however, it can potentially override the cssText styles from other cards, or be overridden by them too.

I'll try appending the styles to cssText, instead of overriding them which should fix this issue.

jcwillox commented 3 years ago

This should be fixed in 0.3.3

michaelarnauts commented 3 years ago

0.3.3 indeed fixed the issue. Thanks!