Building plugins IS contributing to WordPress

I feel at this point in time it really needs to be stated that building plugins that extend the functionality of WordPress is just as important for the ecosystem — possibly more, depending on the nature of the plugin — as contributing to core.

WordPress isn’t as huge as it is because of blogs. It’s huge because plugins make it viable as a general purpose CMS. In fact, there’s one particular plugin that is more responsible for its general-purpose flexibility than any other.

If WordPress were limited to its core functionality, no one would even be talking about it today… because it would have been abandoned at least a decade ago.

That is all.

Bootstrap 5 Carousel: position captions outside (i.e. below) the images

(If you want to get right to the point, a full code example is provided at the bottom of this post.)

I’m not a Bootstrap expert. During most of its evolution, I’ve mostly ignored it in favor of rolling my own… everything. I finally really embraced Bootstrap when I had a rush project in October 2022 that was way too precisely designed to work with WordPress, especially Gutenberg. (And the client didn’t need editing capabilities.) So I decided to hand-code it, but to use Bootstrap to… uh… bootstrap my HTML/CSS layouts.

I think Bootstrap 5 is excellent. I wish Gutenberg was built on top of it instead of the idiosyncratic house of cards it’s actually built on, but whatever.

As it happens, I’m actually now using Bootstrap 5 with Gutenberg for some custom blocks, specifically a Carousel block. One of the options I want to provide in my block is the ability to show the carousel’s captions and controls outside of the image, but apparently, at least with Bootstrap 5, that’s not an option.

I decided to Google for a quick solution before creating my own and I came across… this. I’m sure it gets the job done, but it seems severely over-engineered, so here I’m presenting my own comparatively simple, CSS-only solution.

Basically there are two things you need to do: 1) move the absolute-positioned caption text below the image, and 2) add padding to the bottom of the container, so the caption has somewhere to go instead of just overlapping the content below it.

Let’s start with the second item first:

.carousel { padding-bottom: 4rem; }

There may be some trial and error here, as you need to make sure you’re accommodating captions of varying length. I will admit this is not fully thought out here, and unlike the rest of what is about to follow, it may be a deal breaker under certain circumstances. But let’s assume your captions are a fairly consistent length, and you can determine how much padding you need.

Getting the caption pushed below the images is easy…

.carousel-caption { top: 100%; }

…except, oops, vertical overflow is hidden. Let’s fix that:

.carousel-inner { overflow: visible; }

Of course, if you have your transition effect set to slide (which is the default), that now spews stuff all over the page in an ugly way. But we can fix that by hiding overflow on the outer carousel element instead:

.carousel { overflow: hidden; }

You might, at this point, wonder why I didn’t just set overflow-y: visible on .carousel-inner which seems perfectly reasonable, and which, of course, I tried. But for reasons I couldn’t be bothered with investigating, that ended up causing .carousel-inner to just show a vertical scrollbar and not display the caption unless you scrolled it. Ugh. No matter, the above takes care of it.

That’s pretty much it, as far as the captions go. But if you’re using the controls (previous/next arrows) or indicators (dots/lines for the number of slides and current selection), you’ll notice there’s some weirdness to their placement, so let’s fix that too. The indicators just get shoved to the bottom of the container, so your bottom padding can accommodate that. But if you want to move them back up onto the image, you just need to offset that extra padding, like this:

.carousel-indicators { bottom: 4rem; }

Make that value the same as the bottom padding you added to .carousel itself.

As for the controls, since you’ve made the overall container taller, they’re now a bit too low rather than being vertically centered on the image. Guess what… setting their bottom value to match the extra bottom padding fixes their placement too!

.carousel-control-next, .carousel-control-prev { bottom: 4rem; }

So, putting it all together as concisely as possible, here’s what we have:

.carousel { overflow: hidden; padding-bottom: 4rem; }
.carousel-caption { top: 100%; }
.carousel-inner { overflow: visible; }
.carousel-control-next, .carousel-control-prev, .carousel-indicators { bottom: 4rem; }

ST:TNG Treadmill Review #31: Allegiance

Allegiance
Season 3 Episode 18
Original airdate: March 24, 1990

Netflix Synopsis

Capt. Picard is kidnapped and held with three different aliens, while an impostor takes his place aboard the Enterprise.

My Brief Review

At first I was inclined to skip this episode; for some reason the synopsis didn’t appeal to me. But I’m glad I didn’t, because this is another classic episode that I remember well from the original airing.

Picard and three other species are imprisoned in a strange room. They are four archetypes, and their differences create conflict as they try to find an escape. This part of the story has a very strong Twilight Zone vibe for me, specifically the legendary episode “Five Characters in Search of an Exit.” If this were the entire story it would be a great episode, but there’s another half…

The real Picard has been replaced with an exact replica. Well… almost an exact replica. He has Picard’s knowledge, but his behavior is… well, just a bit off. In ways that at first merely confuse but ultimately nearly kill the entire crew.

Will Riker orchestrate a mutiny to save the Enterprise? You’ll have to watch to find out. I’ll just say it was a weird feeling to watch this episode literally at the very hour that the House of Representatives is debating the second impeachment of Donald Trump.

Memorable Moment

There are plenty of memorable moments in this episode, but definitely the most lasting image for me is of Picard first discovering the “food” being offered in the prison… basically a red translucent hockey puck.

Crew Rando

I found myself strangely aware of all of the random people just roaming the halls on the Enterprise in this episode. In particular, I found it odd that so many people would just be passing by the quarters of whichever officer hosts the poker games. But guess what… “backflip master” Crewman Martinez once again makes an appearance, apparently… I still haven’t actually figured out who he is.

Distance Rating: 4K

IMDb score: a shockingly low 7.5/10

Climate as Proxy for Capital Within the Minneapolis Skyway System

Climate as Proxy for Capital Within the Minneapolis Skyway System
I spent the better part of the last decade working in downtown Minneapolis, and as such became intimately familiar with its convenience, its obscure corners, and, as this scholarly longread explores, its complex challenges in managing expectations between public and private spaces, and the class- and race-based divisions it engendered.

When walking through the skyway system, it is very difficult not to keep moving. The difficulty of strolling, sitting, standing, or stopping inherently excludes certain groups, particularly the poor and the elderly. Similarly, the ease of skyway access to certain populations (e.g. suburban commuters, office workers) lies in stark contrast to the hidden access points to the street.

(Via kottke.org.)

room34.com redesigned

I just finished (seriously… like, 5 minutes ago) rolling out a new redesign of my business website, room34.com. I think it’s pretty neat, so… check it out!