Could you give me an example Yan?
It is probably me being thick, but I see no difference in having a pre-typed root or not having it visible in the editor:
Pre-typed (before adding code)
root {
}
Pre-typed (code added - no children)
root {
color: #4093f5;
text-transform: uppercase;
letter-spacing: -3px;
}
Pre-typed (code added - with a child selector)
root .typed {
color: #4093f5;
text-transform: uppercase;
letter-spacing: -3px;
}
Now compare that with root being automatically applied to these same CSS declarations
Code added to the editor (no child selectors)
color: #4093f5;
text-transform: uppercase;
letter-spacing: -3px;
output
root {
color: #4093f5;
text-transform: uppercase;
letter-spacing: -3px;
}
Code added to the editor with a child selector
.typed {
color: #4093f5;
text-transform: uppercase;
letter-spacing: -3px;
}
Output
root .typed {
color: #4093f5;
text-transform: uppercase;
letter-spacing: -3px;
}
And just for good measure if I wanted to target two children - the code added to the editor would look like this
.typed {
color: #4093f5;
text-transform: uppercase;
letter-spacing: -3px;
}
.suffix {
color: #4093f5;
text-transform: uppercase;
letter-spacing: -3px;
}
And the output would be:
root .typed {
color: #4093f5;
text-transform: uppercase;
letter-spacing: -3px;
}
root .suffix {
color: #4093f5;
text-transform: uppercase;
letter-spacing: -3px;
}
not sure if the singular root would be enough at the start of the rule for the second child or if a second root would need to be place before it also?
Again it might just be me being thick Yan, but I cannot see any difference to how I would do it normally if typing in the code manually? As mentioned at the start perhaps you have an example that is complex and would not be possible.
p.s. if you are targeting two elements on a page then page CSS would be for this. This is just for styling a singular element and any childs of that singular element.