appreciated / card

A component similar webcomponent to <paper-card> for Vaadin 10
Apache License 2.0
6 stars 3 forks source link

Theming via @CSSImport ignored #21

Open incaseoftrouble opened 4 years ago

incaseoftrouble commented 4 years ago

Hi,

maybe I am doing something stupid but it seems that @CSSImport(..., themeFor="clickable-card") is not applied to the shadow dom. The <style include="<id>"> directive is missing / overwritten by the template JS in the element's shadow dom, the custom style / dom element is present in <head>. I want to use this to theme the content div with a border.

appreciated commented 4 years ago

Styling via @CSSImport is currently not supported.

Try the following instead:

Card c ...;
card.getTemplateDiv().getStyle().set("...", "...");
incaseoftrouble commented 4 years ago

Perfect, works for me. Only using this to mark user-selected items, so traffic is quite low.

So this would rather be nice-to-have I guess. Thanks for your hint.

thigg commented 3 years ago

It would be really nice if this could be fixed, or better documented. Also, it would be good to have more CSS variables that can be used, e.g. for background-color.