Reputation: 2675
I have a HTML node where the parent has a class "bp3-multi-select-popover". I want to access all checkboxes nested inside this parent and give a background-color of green. The checkboxes will always be inside an li. Please advice. I do not want to change it generally throughout my app. Only when the checkbox is under .bp3-multi-select-popover class
I need to change .bp3-control input:checked ! .bp3-control-indicator with a background of green.
This is what I did to change:
.bp3-multi-select-popover
> div
> div
> ul
> li
> a
> div
> div
> span.bp3-control
input:checked
~ .bp3-control-indicator {
background-color: green;
}
Please enlighten me on a way to fix this.
This is the link:CodeSandbox
Upvotes: 0
Views: 179
Reputation: 1026
Try this
.bp3-control input:checked ~ .bp3-control-indicator {
background-color: green !important;
}
Upvotes: 0
Reputation: 2675
Got it:
.bp3-multi-select-popover
.bp3-control
input:checked
~ .bp3-control-indicator {
background-color: green;
}
Thanks.
Upvotes: 0
Reputation: 1523
You do not need the full path which is prone to errors, you can just use the last bit of the selector:
.bp3-multi-select-popover .bp3-control input:checked ~ .bp3-control-indicator {
background-color: green;
}
Upvotes: 1