Skip to main content

Is it possible to have an element change colors based on a custom hex value field in a Partner Account. I am attempting to allow a Partner Community Account to control elements of their branding that is visible to their Customer Community Users.

In V1, there are two approaches I’ve found to be fairly straightforward.  The first is to use a either a Salesforce (preferred) or Skuid formula field to set a Class name based on some criteria.  Then you can use merge syntax in either the class setting in the page composer or in template html markup.  If you are using a component like a deck that has model context, you should use the Model merge syntax like class=“{{className}}”.  We use this approach with color coding tasks based on their status.  


If you simply want to swap out the color, you can setup the color code in the formula field and use a style attribute with the merge syntax to set the color, like Peter indicated.


Here are a couple other posts with more detail on this:


https://community.skuid.com/t/conditional-css-deck


https://community.skuid.com/t/color-picklist-value-based-on-status


I have word that Spark will be getting conditional styling, which I’m very excited about.


Reply