Recently, I came across the sibling combinator feature in CSS and I'm attempting to transfer some of my JavaScript functionality into CSS. However, I'm encountering some difficulties with this transition.
<div class="box">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="m64 50-4-8h-6v-4c0-1.1-0.9-2-2-2h-18c-1.1 0-2 0.9-2 2v16l2 2h2.536c-0.341 0.588-0.536 1.271-0.536 2 0 2.209 1.791 4 4 4s4-1.791 4-4c0-0.729-0.196-1.412-0.536-2h11.073c-0.341 0.588-0.537 1.271-0.537 2 0 2.209 1.791 4 4 4s4-1.791 4-4c0-0.729-0.196-1.412-0.537-2h2.537v-6zm-10 0v-6h4.146l3 6h-7.146z"/></svg>
<div><input type="text"></div>
<div><input type="text"></div>
<div><input type="text"></div>
</div>
I've managed to alter the color of my svg image using:
path{fill:#f00}
But, I wish to change the color only when an input field within .box is focused.
.box svg path~.box div input:focus{fill:#f00}
Given that they are not direct siblings, I have employed prefixes to place them on the same level.
Can you guide me on what might be going wrong here?