hobbyquaker / node-red-contrib-polymer

A Polymer based Dashboard UI for Node-RED
MIT License
21 stars 0 forks source link

Class attribute - (how) does it work? #41

Open M0ebiu5 opened 7 years ago

M0ebiu5 commented 7 years ago

I tried the following: Entered a class name in the class attribute field. Defined the class in the template node.

But it does not work. Class name also does not show up in page source... Did i do something wrong, or is the this feature not yet functional?

hobbyquaker commented 7 years ago

Try the following: Add a class to a Button, e.g. blue - then edit the Site node (there is a CSS editor in the options) and put in there .blue { color: blue; } - now the Label of the button should be blue. All this needs a lot of documentation, because sometimes it's necessary to know which elements reside inside a widget to get useful results. Also an important thing: you can't define CSS in a template node. Polymer scopes this, so if you define CSS in a template it will only affect things inside that template. That's the reason for the CSS option in the Site node. Let me know if this helps :)

hobbyquaker commented 7 years ago

PS.: the class attribute is not tested everywhere, I know it works with the Button and i know it does not work with Groups, pls give me some time, will fix and test it for all elements on next saturday or sunday. :)

M0ebiu5 commented 7 years ago

Thanks for the explanation! My use case for the class / css feature is mostly the html widget to style external html.