NO BUG: Default width issue in code and shortcode elements

Browser: Chrome 110
OS: macOS / Windows / Linux / etc.
URL: Link to a page that illustrates this issue
Video: Short screen recording that illustrates this issue (free tool: jam.dev)

In bricks, all elements default to auto width, which is great. However, code and shortcode elements have a default width of 100%, which is problematic.

For example, when we put these two elements in the same container, we can’t use flex options until we change their width, because they don’t work at all.

Or, for example, if we use one of these two elements next to an svg icon in a div element, it will affect the size of the svg icon and make it smaller.

I know this can be easily solved by setting the width of these elements to auto , but it would save a few clicks if you made this the default.

thanks

Hi Victor,
Thanks so much for your report!

You can activate “render without wrapper” for the code element so that the wrapper, including the width, is not output.

For the shortcode element it depends a lot on what the shortcode contains - the default was set a long time ago and changing it now would mean that no shortcode content would have the width anymore - even if it is needed (depending on the content). In other words, layouts that have been working forever will break.

If you need width auto, add it to the element or define a general rule for the shortcode element (e.g. in the Bricks settings » custom CSS or your child theme) that sets the shortcode width to auto.

Best regards,
timmse

1 Like

Hi @timmse, Thanks for the details. Also, apologies for the delay. I forgot to reply.

You can activate “render without wrapper” for the code element so that the wrapper, including the width, is not output.

Even if we enable “render without wrapper”, the problem is solved in the frontend, but in the builder it is still full width. Am I missing something?

No, that’s the correct behavior (see the notice):