Use css transition to animate an external element

Hello everyone !

I was messing around with css transitions, that i find fantastics, but I was wondering wether it was possible to use transitions on one CSS elements onto another. For exemple, let’s imagine we have to box, one green and one blue, would it be possible to hover over one box to change the color of the other ? Something like

.greenbox {
    background-color : green;
    transition : background-color 2s;

}

.bluebox:hover {
    .greenbox {
     background-color : red;
     }
}