Giter Site home page Giter Site logo

Comments (6)

hotNipi avatar hotNipi commented on May 29, 2024

The <font> tag is deprecated.
https://www.w3schools.com/tags/tag_font.asp

from node-red-dashboard.

va2px avatar va2px commented on May 29, 2024

It appears the only thing that works for now is to apply a style. That affect both the label and the value.

image

from node-red-dashboard.

hotNipi avatar hotNipi commented on May 29, 2024

Not the only way. You can add CSS class to widget and make that widget having different colors for label and value

.my-colored-text-widget label{ color:greenyellow; } .my-colored-text-widget span{ color:whitesmoke; }

from node-red-dashboard.

va2px avatar va2px commented on May 29, 2024

Well, I am gonna need a crash course on CSS class.

from node-red-dashboard.

hotNipi avatar hotNipi commented on May 29, 2024

On top of that, you can add css classes dynamically using msg.class

Her's the example:
[{"id":"b607d1be694f207f","type":"ui-text","z":"4eb808f5e19fb7e2","group":"46aafe434565ad2c","order":13,"width":"3","height":"1","name":"","label":"I'm label","format":"{{msg.payload}}","layout":"row-spread","style":false,"font":"","fontSize":"20","color":"#8c27a0","className":"","x":440,"y":1760,"wires":[]},{"id":"8eed72a47437bd32","type":"inject","z":"4eb808f5e19fb7e2","name":"label green & text red","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"class","v":"my-colored-text-widget label-green text-red","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Text is red, Label is green","payloadType":"str","x":200,"y":1700,"wires":[["b607d1be694f207f"]]},{"id":"626c042436c32dab","type":"inject","z":"4eb808f5e19fb7e2","name":"text red","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"class","v":"my-colored-text-widget text-red","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Text is red","payloadType":"str","x":250,"y":1740,"wires":[["b607d1be694f207f"]]},{"id":"f07702fbf8436d12","type":"inject","z":"4eb808f5e19fb7e2","name":"label green","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"class","v":"my-colored-text-widget label-green","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Label is green","payloadType":"str","x":240,"y":1820,"wires":[["b607d1be694f207f"]]},{"id":"fdb37f42b4b741d0","type":"inject","z":"4eb808f5e19fb7e2","name":"text orange","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"class","v":"my-colored-text-widget text-orange","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Text is orange","payloadType":"str","x":240,"y":1780,"wires":[["b607d1be694f207f"]]},{"id":"d703e5e7c25f23ba","type":"ui-template","z":"4eb808f5e19fb7e2","group":"","page":"","ui":"da26eafa8eb48ab3","name":"Dasboard 2.0 CSS","order":0,"width":0,"height":0,"head":"","format":".my-colored-text-widget.label-green label{\n color:greenyellow;\n}\n.my-colored-text-widget.text-red span{\n color:rgb(255, 0, 0);\n}\n.my-colored-text-widget.text-orange span{\n color:rgb(255, 145, 0);\n}\n","storeOutMessages":true,"passthru":true,"resendOnRefresh":true,"templateScope":"site:style","className":"","x":170,"y":1660,"wires":[[]]},{"id":"46aafe434565ad2c","type":"ui-group","name":"Regular Layout","page":"19eb6d108e9275e2","width":"6","height":"1","order":2,"showTitle":false,"className":"","visible":"true","disabled":"false"},{"id":"da26eafa8eb48ab3","type":"ui-base","name":"Board","path":"/dashboard"},{"id":"19eb6d108e9275e2","type":"ui-page","name":"Examples","ui":"da26eafa8eb48ab3","path":"/examples","icon":"","layout":"grid","theme":"a965ccfef139317a","order":-1,"className":"","visible":"true","disabled":"false"},{"id":"a965ccfef139317a","type":"ui-theme","name":"Default","colors":{"surface":"#5c5c5c","primary":"#0094ce","bgPage":"#383838","groupBg":"#4f4f4f","groupOutline":"#858585"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]

from node-red-dashboard.

va2px avatar va2px commented on May 29, 2024

Now I get it.

Thanks for the help.

from node-red-dashboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.