Dashboards & Visualizations

CSS for Checkboxes

Software-Simian
Path Finder

Hello,

i have checkboxes that will serve as filters. Now i want to color code the Text next to the checkbox NOT the Label on top. I already got that working:

#input_severity_low {
text-shadow: 1px 1px 2px black, 0 0 25px green, 0 0 5px darkgreen;
font-variant: small-caps;
}

Howeverthis really only affects the label over the checkbox. I want the Text of (next to) the checkbox to be altered.

My Web-Analyzer shows me something like:

<label data-test="label" for="clickable-ae3424f7-85da-4201-9152-a98bf237f15d" data-size="medium"
class="SwitchStyles__StyledLabel-tie4e6-7 hGDbnW">
4 - Low (<some number>)</label>

However the CSS Syle does not react to the class.

Anyone any ideas?

 

Kind regards,

Mike

Labels (1)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

You can select which text you want to change by its value e.g. "4 - Low (<some number>)" or by its position  index e.g. 3

        <style>
          #checkbox_input_id div[data-test-value="4 - Low (<some number>)"] label {
            color: red !important;
          }
          #checkbox_input_id div:nth-child(3) label {
            color: green !important;
          }
        </style>

 

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

You can select which text you want to change by its value e.g. "4 - Low (<some number>)" or by its position  index e.g. 3

        <style>
          #checkbox_input_id div[data-test-value="4 - Low (<some number>)"] label {
            color: red !important;
          }
          #checkbox_input_id div:nth-child(3) label {
            color: green !important;
          }
        </style>

 

Software-Simian
Path Finder

Awesome thanks!!

was actually child(2) but anyhow works like a charme!!

 

Thanks,

Mike

0 Karma
Get Updates on the Splunk Community!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco &#43; Splunk! We’ve ...