WIP: %root% is not working in 'child' selector

Browser: Firefox
OS: Windows

Found an ?unexpected? behavior in new Selector UI. I create a class .content for a gutenberg element and then added a selector > p:first-child:

изображение

In custom css %root% selector still links to a ‘parent’ class, not to ‘child’ selector.

Hi,
Thanks so much for your report!

Sorry, but I don’t understand as %root% always refers to the selected element ID or class - in this case .content. Maybe you can show the whole scenario?

Best regards,
timmse

Hi,
A little misunderstanding happens. I thought %root% refers to current selector. Since then, it’s more like ‘Feature Requests’, than a bug

I think it’s neither one nor the other :slight_smile: But as I said, I need more context to understand the problem/possible improvement.

Okay. I have a class .content with a selector in it > p:first-child called First Paragraph. I choose the selector (see img in original post), go to CSS tab and place %root% with styles:

%root% {
    color: red;
}

It’s affecting the class .content, not the currently active selector .content > p:first-child. Is it possible to improve %root% to be the shorthand of .content > p:first-child in this scenario?

Probably not, but after consultation with the team, we are considering introducing a unique selector for this purpose. I have moved the thread accordingly, as it is not a bug.

We will update the thread as usual as soon as the improvement has been implemented.

1 Like