I have a switch button enabled in my Apex Forms page for which I have custom settings as Yes and No. I want to change the colour of the button to green on yes(selection) and red by default/unselection.
<input type="checkbox" id="P3_RESTRICTED" name="P3_RESTRICTED" value="Yes" data-on-label="Yes" data-off-value="No" data-off-label="No">
This is the html for that switch button.
This can be achieved by overriding the default css classes. In this case I'm using the APEX provided css variables.
In page attributes > CSS > Inline, add
This will ensure checked is rendered as green and unchecked is rendered as red.