I’m working with a site running 1.9, and I noticed that when ‘root’ is used in the CSS panel of an object with a query, or one of it’s children, does not seem to generate that CSS, or is not generating it correctly as a class instead of an ID, making use of the ‘root’ reference in the CSS panel of queries and their children useless.
I would think it should generate the class value, as seems to implied by this prior bug (SOLVED: CSS media queries don't apply on query loops), where media queries with root were still generating ID values instead of class value?
Steps to replicate:
Create a query enclosure.
Add an object into that enclosure.
2a. When generating code, the unique id of that enclosed object is applied as a class instead. ex: .brxe-ofefsl
Try to address that enclosed object by using ‘root’ in the CSS panel. ex: root {border: solid 1px red;}. The change will show up correctly in the builder… but…
Save the change and load the public version of the page, and the code will not be present.
I’ve checked the generated CSS for the page, and I’m not finding any instance of CSS that used ‘root’ somewhere in its reference. Either as a class or an id. CSS that is hard-coded to reference the object’s id as a class does get generated. So, root {border:etc…} does not generate code, while .brxe-ofefsl {border:etc…} does show up in the generated CSS.
Hi Rob,
Thanks so much for your report, and welcome to the forum!
root is a placeholder for the ID or the class that gets converted on the fly to the “correct” ID or class name (#brxe-abcde or .className). Otherwise, you could use the root keyword only once.
In the loop, IDs behave differently than usual since IDs may only occur once in the DOM. Accordingly, they are converted into classes. Accordingly, this is not a bug.
Good to know about multiple uses of ‘root’, but that wasn’t the issue I was running into. The problem was that any line that included ‘root’ would apparently just get skipped over.
I assume from your message about fixing this for 1.9.1 that you were able to replicate the issue? If not, let me know and I’ll see if I can either reproduce it on an install that I can share, or try to identify if there are any other contributing factors.