You can customize the Modula lightbox with its settings or with CSS. The lightbox is the pop-up that shows a large image when a visitor clicks it. CSS is the code that controls how a page looks.
Most of the lightbox look is in the gallery settings. Use the CSS below when you need something they don’t cover. Examples are another font for the captions, bigger arrows or no thumbnails on phones.
Check the settings first
In the gallery editor, open Lightbox. With On click set to Open in lightbox, the Lightbox group has these options:
- Background color
- Show title and Show caption, with their Color, Size (for desktop and mobile) and Boldness
- The Position of the text
- Show thumbnail strip

Albums have their own Background color in the album’s lightbox settings. You can read more in Lightbox & Links.
Where to add the CSS
If the settings don’t do what you need, add CSS to your site. The place depends on your theme.
- With a block theme: Go to Appearance → Editor → Styles. Open the ⋮ menu and choose Additional CSS.
- With a classic theme: Go to Appearance → Customize → Additional CSS.
Each code below changes the Modula lightbox of every gallery and album on the site.
To change the lightbox of one gallery only, replace .modula-fancybox-container with .modula-lightbox-12. Here, 12 is the gallery ID from its shortcode [modula id="12"].
CSS examples to customize the lightbox
Copy the code for the change you want. You can change the values to fit your site.
Change the caption font
.modula-best-grid-gallery .modula-fancybox-container .f-caption {
font-family: Georgia, serif;
font-size: 19px;
color: #ffd700;
}Use a font that your site already loads, for example your theme’s font. The caption color and size are settings in the gallery editor. So you can delete those two lines and keep only the font.
Make the image counter bigger
The counter is the “3 / 12” at the top left of the lightbox.
.modula-best-grid-gallery .modula-fancybox-container .f-counter {
font-size: 22px;
}Add a border to the lightbox image
.modula-best-grid-gallery .modula-fancybox-container .f-panzoom__viewport img {
border: 15px solid antiquewhite;
}Change 15px for the thickness and antiquewhite for the color.
Make the arrows bigger
.modula-best-grid-gallery .modula-fancybox-container .f-button.is-prev,
.modula-best-grid-gallery .modula-fancybox-container .f-button.is-next {
--f-button-width: 70px;
--f-button-height: 70px;
--f-button-svg-width: 32px;
--f-button-svg-height: 32px;
}The first two lines set the size of the button. The last two lines set the size of the arrow inside it.
Move the toolbar buttons to the right edge
The buttons at the top right of the lightbox sit in a row. This code puts them in a column along the right edge, so they cover less of the image:
.modula-best-grid-gallery .modula-fancybox-container .f-carousel__toolbar__column.is-right {
flex-direction: column;
flex-wrap: nowrap;
position: absolute;
top: 0;
right: 0;
}To do this for one gallery only, use .modula-lightbox-12 in place of .modula-fancybox-container, as explained above.
You can then paste the code in the gallery instead of Additional CSS. It then loads only on pages that show that gallery. In the gallery editor, click CSS in the left rail and paste it in Custom CSS.
If you only want fewer buttons, you don’t need CSS. In the gallery editor, open Lightbox, then Lightbox & Links under More settings. Turn off the buttons you don’t want under Show toolbar.
Hide the slideshow progress bar
A thin bar at the top fills up until the next image. It shows when the lightbox plays a slideshow (Enable slideshow in the gallery’s Lightbox settings). It also shows when a Slider gallery moves by itself (Autoplay). To hide the bar, use this code:
.modula-best-grid-gallery .f-progressbar {
display: none !important;
}The slideshow and the autoplay keep working. Only the bar is hidden.
On phones
These codes apply only on screens narrower than 768px. Change the number to move the limit.
Hide the thumbnails on phones
This hides the thumbnail strip and the button that opens it, so the image gets more room.
@media (max-width: 768px) {
.modula-best-grid-gallery .modula-fancybox-container .fancybox__thumbs,
.modula-best-grid-gallery .modula-fancybox-container [data-thumbs-action=toggle] {
display: none !important;
}
}Turn off the zoom on phones
This hides the magnifier of the Zoom extension on small screens. The Zoom setting is Enable lightbox zoom in the Lightbox section of the gallery editor.
@media (max-width: 768px) {
.modula-best-grid-gallery .modula-fancybox-container .modula-native-zoom-lens,
.modula-best-grid-gallery .modula-fancybox-container .modula-native-zoom-window,
.modula-best-grid-gallery .modula-fancybox-container .modula-native-zoom-inner,
.modula-best-grid-gallery .modula-fancybox-container .modula-native-zoom-tint {
display: none !important;
}
}Note: Rounded corners for the gallery images don’t need CSS. Use Rounded corners in Layout → Style. For other places to add CSS, see How to add custom CSS to Modula galleries.