Sorry if the title is not clear, but the idea is how to check css classes attributes values.
In the screenshot i want to check for example inside the class “custom-control-input:checked~.custom-control-label:before” of ::before that background-color value is #3cb39f
I paste here a sample of the code I use with Selenium Library (maybe Browser has other solutions)
The idea here is to provide the target element xpath as a parameter and the needed property (ex: background-color, box-Shadow…)
Color Attribute
[Arguments] ${parameter} ${property}
${isshadowbox} Run Keyword And Return Status
... Execute Javascript
... return window.getComputedStyle(document.evaluate("${parameter}", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue).getPropertyValue('${property}');
Here I first Execute to verify status and property existence, then if status is PASS, you can Execute the same to get the property value.
This will return a rgb value that you can manage.
I usually RETURN Status, custom color word (Green, Red…for readability and property)