Elementspassedtomiddlewareshavea`root` property that is the immediate root/parent of the current element **in the compiled output**, so it references the parent in the already expanded CSS-like structure. Elements have also `parent`propertythatistheimmediateparentofthecurrentelement**fromtheinputstructure**(structurerepresentingtheinputstring).
Thatistosaycssvariablesaccordingtothespecallows:`--foo: if(x > 5) this.width = 10;` and while this value is obviously useless as a variable, and would be invalid in any normal property, it still might be read and acted on by JavaScript and this is supported by Stylis, however things become slightly undefined when we start to include the `{` and `}`productionsinouruseofexoticcssvariables.
Forexampleconsiderthefollowing:`--foo: {};`
WhilethisisvalidCSSandsupported.Itisunclearwhatshouldhappenwhentherulecollideswiththeimplicitblockterminationrulethatallowsi.e`h1{color:red}`(notice the omitted semicolon) to also be a valid CSS production. This results in the following contradiction in: `h1{--example: {}` is it to be treated as `h1{--foo:{;}` or `h1{--foo:{}` the later of which is an unterminated block or in the following: `h1{--foo:{} h1{color:red;}` should it be `h1 {--foo:{}h1{color:red;};` where `{}h1{color:red;` is part of the css variable `--foo`andnotanewruleorshoulditbesomethingelse?
NeverthelessStylisstillsupportstheexoticformshighlightedinthespec,howeveryoushouldconsideritasageneralruletodelimitsuchexoticusesofvariablesinstringsorparenthesesi.e:`h1{--foo:'{'}` or `h1{--foo:({)}`.