Made in Europe, buy from Europe.

Black Friday

65% off Annual plans

25% off Lifetime · 10 per week

Ends December 2

Get the deal →

How to style the Modula filter bar with custom CSS

Updated 3 min read

You can style the Modula filter bar with its settings or with CSS, the code that controls how a page looks. The filter bar has settings for its alignment, position and colors. For the font, the text size and the space around and between the filters, use the CSS below.

Watch how to check the filter bar settings, add the CSS in Additional CSS, and see larger filters with more space on the page.

Check the settings first

The settings may already do what you need, so look at them before you add code. In the gallery editor, open Filters. Under Show the filter bar you can set these options:

  • Alignment
  • Where the bar sits
  • Show as a dropdown
  • Color and Color on hover of the filters
Filters settings in the gallery editor: Alignment, Color and Color on hover for the filter bar

To learn how to set up filters, see How to Use Filters in Modula.

Note: The gallery editor also has Let the theme style pagination and filters, next to the Pagination settings in Layout. When it’s on, Modula drops its own look for the filter buttons and the dropdown, so they follow your theme’s buttons. The filter colors you set still apply.

Where to add the CSS

If the settings don’t cover what you want, 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.

The codes below change the filter bar of every gallery. The !important part keeps Modula’s own filter styles from overriding your values.

To change one gallery only, replace .modula with its selector (#modula-12). A selector is the part of the code that says what to change. Add the code to that gallery’s custom CSS, as shown in How to add custom CSS to Modula galleries.

Make the text larger

This code makes the text of the filters larger.

CSS
.modula .filters .modula_menu__link {
  font-size: 20px !important;
}

Replace 20px with the size you want.

Change the font

This code changes the font of the filters.

CSS
.modula .filters .modula_menu__link {
  font-family: Alef, sans-serif !important;
}

Note: Use a font that your site already loads, for example one of your theme’s fonts. Otherwise the browser falls back to the next font in the list. Font names with spaces need quotes, for example "Open Sans". To load a new font, see How to add a custom font to Modula captions and titles.

Add padding to the filters

Padding is the empty space around the text of a filter. This code adds it.

CSS
.modula .filters .modula_menu__link {
  padding: 8px 16px !important;
}

The first value is the space above and below the text. The second value is the space to the left and right.

Increase the space between the filters

This code adds space between the filters.

CSS
.modula .filters .modula_menu__list {
  column-gap: 30px !important;
}

Replace 30px with the space you want.

Was this page helpful?
0 0

Still stuck?

Can’t find the answer?

Write to us with what you tried and what you expected to happen, and we’ll help you sort it out.