SOLVED: Mobile First: "root"selector in custom CSS of duplicated element gets overridden with ID of original element

Bricks Version: 1.5.7
Browser: Chrome 107
OS: macOS Monterey

Not sure if this is a bug or intentional, but when I save a section as a template, and upon inserting it, the “root” keyword to target the element wrapper gets replaced with the id of the element at the time of saving (ex. #brxe-ruowsk). I think it’s a bug since the styles don’t target the intended element any more (the current element wrapper).

Steps to reproduce:

  1. Create a section or any element
  2. Add custom CSS using the root target keyword (ex. root p { … styles })
  3. Save the element as a template
  4. Insert the template and notice the “root” keyword is now replaced with the default random ID the builder adds on element creation (ex. #brxe-ruowsk).

Hi Ben,
Thanks so much for your report!

Unfortunately, I cannot reproduce the issue. Would you be so kind as to provide a screencast showing and explaining what’s happening?

Best regards,
timmse

Here’s the screen recording. Hope it helps! Bricks template custom CSS bug - YouTube

I just discovered this behavior happens regardless of whether the section gets saved as a template or not.

Steps to reproduce:

  1. Using mobile-first breakpoints
  2. Create an element
  3. Add custom CSS using the root target (example: root {color: red;}). Let’s say this element has an id of brxe-qu5pr2
  4. Duplicate the element
  5. Notice how the new element, in the custom CSS, the root keyword has been replaced with #brxe-qu5pr2 { color: red;}

Hey Ben,
Thanks again. Mobile-first is the crucial hint with this issue.

I’ve added it to the bug tracker.

Best regards,
timmse

1 Like

Hi @timmse. Were you guys able to fix this on 1.6 beta 2? I didn’t see this mentioned in the changelog, so that I can test it. Lmk. Thanks!

Hi Ben,
If it was included in the beta (1 or 2), it would be in the changelog. The fix will probably be included in Bricks 1.6 stable.

Best regards,
timmse

Hi Ben,
We’ve fixed this bug in Bricks 1.6.1, now available as a one-click update within your WordPress Dashboard.

Please let us know if you are still experiencing issues.

Best regards,
timmse

1 Like