change CSS via java script action

0
Hello All,   I want to change CSS at runtime via JS Action. Any idea?   thanks
asked
2 answers
1

I don’t have experience with triggering css changes through a JS action, but what I often do is utilize the dynamic class functionality in your property section.

This way you can:

  • use a microflow or nanoflow to trigger an attribute change (or maybe even a helper entity with attributes client side)
  • End the flow with a refresh
  • Trigger a specific class based on attribute values
  • create classes within your sass folder to have a nice structured design
    • Maybe use a parent class that already has some well known information
    • use a children class for specifics depending on attributes (colors, font sizes, etc)

 

See the set-up below

.parentclass{

   .childclass1{
       background-color: //color;
       color: //color;
       }

   .childclass2{
      background-color: //color;
      color: //color;
      }
}

 

answered
1

This is very basic JavaScript. Check this thread: https://intellipaat.com/community/21064/how-to-change-an-elements-class-with-javascript

answered