Dashboards & Visualizations

In a dashboard, can we change background color for the Splunk input choices ?

VI371887
Path Finder

I have a dashboard where panels hide/show according to the linked list choices you are making,

Now, i want the choices to have a specific color change and font color. So, when i am trying to use a certain background color, all of the linked list would that background color.

 <panel>
    <html>
     <style>
       #link  {         
             color: black !important;
             font-weight: bold !important;
             background: #e3e7ea !important;


 }
         </style>    </html>     </panel> 
0 Karma

kumaranv
Path Finder

Perfect. It works. Thanks

<row>
<panel depends="$hide$">
<html>
<style>

#list button{
color: blue;
background: $background_color_token$;
}

</style>
</html>
</panel>
<panel id="list">
<input type="link" token="field1">
<label>field1</label>
<choice value="1">One</choice>
<choice value="2">Two</choice>
<choice value="3">Three</choice>
<default>1</default>
<change>
<condition value="1">
<set token="background_color_token">blue</set>
</condition>
<condition value="2">
<set token="background_color_token">green</set>
</condition>
<condition value="3">
<set token="background_color_token">red</set>
</condition>

</change>
</input>
</panel>
</row>

0 Karma

payl_chdhry
Explorer

@VI371887 know this is very old post, but were you ever successful in doing this?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You can use tokens in the CSS.

background-color: $background_color_token$ |important;

 Set the token elsewhere in the dashboard.

0 Karma

kumaranv
Path Finder

Could you please provide an example of passing token into CSS attributes. Thanks

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

That is an example of a token being used in CSS. The token needs to be set to a value elsewhere in the dashboard.

0 Karma
Get Updates on the Splunk Community!

Splunk Observability Cloud | Customer Survey!

If you use Splunk Observability Cloud, we invite you to share your valuable insights with us through a brief ...

.conf23 | Get Your Cybersecurity Defense Analyst Certification in Vegas

We’re excited to announce a new Splunk certification exam being released at .conf23! If you’re going to Las ...

Starting With Observability: OpenTelemetry Best Practices

Tech Talk Starting With Observability: OpenTelemetry Best Practices Tuesday, October 17, 2023   |  11AM PST / ...