What I'm searching
In CSS:
E ~ F { } stands for any F node which is preceded by an E node.
I'm searching for any E node which is succeeded by an F node
Or in other words:
I want something like of E + F {}, but
- not style
F, butE - style all
EbeforeF
Concrete problem
I have a list of sibling elements. Some of them can be .selected, one of them could be .focused, some of them can be neither. If any sibling is .focused, all .selected siblings should style in a certain way.
Example situation
<row class="selected"> content1</row>
<row class=""> content2</row>
<row class="selected"> content3</row>
<row class="selected focused">content4</row>
<row class=""> content5</row>
<row class="selected"> content6</row>
<row class=""> content7</row>
In this example content1,3,4,6 should be styled in a certain way.
I have a solution for content4 and 6, but I can't find the solution for content1 and 3.
Constraints:
- I cannot use anything else but CSS
- I can only work with sibling elements
- This is for Gtk's CSS, but I guess the solution is the same as in usual CSS