NO BUG: Issues with Bricks Image Element default behaviour

Similar issue is with both the current stable version and 2.0 alpha.

The bricks image element has the structure:

<figure id="" class="brxe-image tag caption">
<img class="">
<figcaption class="bricks-image-caption">some caption</figcaption>
</figure>

Now, with the default bricks styles:

  • Caption is at the top of image with a background linear gradient,

1

(notice position: absolute !important)

  • The caption could in principle contain links (like in my case), but links are disabled using “pointer-events: none”, as well as their color and text-decoration.

  • The figure element is inline-block by default, which can be changed using the layout settings for the individual element, but cannot be changed for all through theme styles (although it is not a problem in most cases).

Created a test page, verify everything here: What is Lorem Ipsum? – gray-caterpillar-240740.hostingersite.com

So, why is this the default setting?

Even the images inside the post content are set to center align by default.

In the current stable version for example, text-align:left!important on the post-content element’s custom css settings does not work, you need to add it in the page settings or global css settings.

Most of these settings can be overridden much easily in 2.0 fortunately, except the position: absolute !important that I mentioned above, for which you need to add a position:relative in the page setting’s custom css or the global custom css (actually, I was only able to override it once by adding the required css in the page setting’s custom css, but apparently I can’t do it now for some reason, and adding it on global css also doesn’t work).

This what should it look like with attachment caption by default imo:

The css to achieve this is in 2.0 is:

%root% figure{
  position:static;
  overflow:visible;
}

%root% figcaption{
  position:relative!important;
  margin-top:0.3em;
  line-height:1.62em;
  text-align:left;
  background:none;
  color:#515151;
  padding:0;
  pointer-events:auto;
}

%root% figcaption a{
  color:blue;
}

%root% figcaption a:hover{
 text-decoration:underline;
}

The css for figure is to be added not on the image element, but any parent of the image element, rest can be added simply on the image element. And again I was not able to override the default position:relative!important; on figcaption element.

Although I kinda feel like the only one complaining and this feels like a rant at this point, so this might not be that important. But again it’s such a trivial thing, which I don’t think should require 10 lines of custom css to customize.

About 2.5 years ago (time flies so fast xD) I posted this feature request for caption controls: Give controls for Captions in here I shared a similar fix that works for the current stable version of bricks, however it doesn’t include the fix for pointer-events and anchor tag style.

Please guide if I’m doing something wrong, provide caption controls if possible as you release 2.0.

P.S. I love all the new features in 2.0

Hi Pranav,
Thank you for your report. However, I don’t know where exactly the bug is supposed to be. The caption styling is a default style that has been around for ages.

It is correct that there are still no theme style settings for it, but your feature request thread from back then shows little demand for it (5 likes and one comment).

You can override the default styling in the Bricks Settings.» Custom CSS globally and customize it however you want. The !important statement for the positioning is certainly not pleasant, but it can also be overwritten.

This is everything you need to reset the defaults:

.brxe-image figcaption.bricks-image-caption {
  all: unset; /*unsets everything */
  position: static !important;
  display: contents;
}

I’m marking the report as a no bug for now because, as I said, I don’t understand where exactly the bug is. If you still think there is one, tell me where and I’ll be happy to take another look at it.

Best regards,
timmse