NO BUG: Where Bricks saves styles depending on how the style is applied

Bricks 2.0.1.
I’ve noticed that Bricks saves CSS styles in different places depending on how they are added to an element, but I think it should actually work the other way around.

For example, when you style an element via Bricks > Custom Code > Custom CSS, then:
{A5B21B88-76C8-4A2A-A0FC-34134342C3F9} 1

Group 28

Everything works correctly — the CSS is saved in the global CSS file.

When styles are added via Bricks > Page Settings > Custom Code, then:

{4A4A076B-493D-4436-9474-7DC9A9C4AC22} 1

{0BEFD51C-97E0-468E-AA67-B3536BCF8A06} 1

They are saved in the page-specific external CSS file, but they appear above other styles added differently.

If you add styles by using the visual panel (clicking options)

{9074D999-E468-44F1-A67E-E63B29C9C2E9} 1

or by manually entering styles in the CSS field, then:

{DB802B03-8F6D-48DF-A296-D3201EFA64C2} 1

These styles are also saved in an external CSS file, but below the ones added via Bricks > Page Settings > Custom Code.

However, when you add a style as a class from the panel, then:
7

It’s saved in the page’s HTML inside a block.

But I believe it should be the other way around:

When using the class system, the styles should be saved in an external CSS file,

and when a style is added directly to an element without a class, it should go into the HTML section.

Hi Dominik,
Welcome to the forum, and thanks for your report!

That’s actually not a bug, but how it currently works, see: WIP: How to transfer bricks-frontend-inline-inline-css styles to a file? - #18 by timmse

We are still working on moving class styles to a separate file instead of outputting them inline, and will update the linked thread once it has been implemented.

Best regards,
timmse

1 Like