Utility Classes

The utility classes of the Custom theme, and the class names its JavaScript relies on.

Table of Contents

Utility classes

Utility classes adjust the layout in targeted ways where the block editor reaches its limits. Add them under Advanced › Additional CSS class(es). We remove a utility class once WordPress covers the same thing in core.

ClassEffectTypical use
is-style-all-unsetall: unset; box-sizing: border-box; resets the element to a clean initial stateBase for custom components in block content
is-style-expanded-click-containerposition: relative; isolation: isolate; prepares a wrapper for an expanded click areaThe card or list item that should become fully clickable
is-style-expand-click-afterStretches the first link or button over the whole container with an absolutely positioned ::after, with a focus outline on :focus-visible. Works on the interactive element itself or on a wrapper, where it takes the first link or buttonFully clickable cards, keyboard focus included
is-style-expand-click-beforeThe same with ::before. Use one of the two per componentWhen ::after is already taken
is-style-over-expanded-clickLifts an element above the expanded click areaA second link inside a fully clickable card
is-style-hide-scrollbarHides the native scrollbar; scrolling still worksHorizontal overflow areas such as chips
is-style-hyphens-autohyphens: auto with word breakingNarrow columns, cards, long URLs
is-style-iconfill: currentColor; flex-shrink: 0; at 1.5remInline SVGs in buttons, menus, badges
is-style-icon-smallThe same at 1.25remDense interfaces, secondary actions
is-style-overflow-clipoverflow: clip: no scrollbar, nothing visible outsideDecorative masking, tightly cropped media
is-style-text-balancetext-wrap: balance distributes lines evenlyMulti-line headings
is-style-text-overflow-ellipsisOne line, cut off with an ellipsisTitles and labels that must not wrap
is-style-visually-hiddenHidden on screen, read by assistive technology. Does not become visible on focusLabels for icon-only buttons, screen reader text
is-style-flex-grow-0flex-grow: 0The item keeps its intrinsic width
is-style-flex-grow-1flex-grow: 1The item fills the remaining space
is-style-flex-grow-99999flex-grow: 99999, dominates every other itemOne item takes as much space as possible
is-style-flex-shrink-0flex-shrink: 0The item is never compressed, for example an icon
is-style-flex-shrink-1flex-shrink: 1The default behaviour, restored
is-style-justify-content-centerjustify-content: center, flex containers onlyCentre content in a row or column
is-style-justify-items-centerjustify-items: center, grid containers onlyCentre grid children within their track
is-style-order--1order: -1Move an item to the front
is-style-order-0 is-style-order-1 is-style-order-2 is-style-order-3 is-style-order-4 is-style-order-5 is-style-order-6 is-style-order-7 is-style-order-8 is-style-order-9order: 0 to order: 9Reorder items manually
is-style-count-upNo styling: a hook for the JavaScript, which counts the number up when it enters the viewportFigures in the counting facts pattern

Sliders

The sliders use Swiper, bundled locally. The slider patterns come prepared; when you build your own, these classes must be present:

ClassRole
.swiperOn a parent of the slider wrapper; initialises the slider
.swiper-wrapperThe direct parent of the moving items
.swiper-slideEach moving item; added automatically
.swiper-button-prev button, .swiper-button-next buttonThe previous and next buttons

The number of visible slides changes at 500, 700 and 900px.


Class names the JavaScript relies on

The modules of the Custom theme select on fixed names. Renaming one of them in a pattern silently switches the behaviour off.

BehaviourRequired hooks
Slider.swiper > .swiper-wrapper, .swiper-button-prev button, .swiper-button-next button
Tabs (hash for the open tab).wp-block-tabs .wp-block-tab-list, button[aria-controls]: the panel ID goes into location.hash; reading it back is the core block’s own job
Term filter.filter-container around the filterable area, .item per entry, .filter-term inside an item for the text that is filtered on
Counting numbers.is-style-count-up
Table of contents#toc-box for the list, #toc-content for the headings it reads; [data-toc-container], [data-toc-current]
Header and overlay.toggle-button-menu, #toggle-container-menu, .toggle-button-search, .toggle-container-search
Collapsible footer navigation.navigation-container--is-collapsible around a .navigation-title paragraph and the menu
Share and print#kbButtonShare and #kbButtonPrint on the button wrappers; the script uses the link inside
Back to top.back-to-top

The table of contents lists every heading inside #toc-content that has an ID. WordPress assigns IDs to headings automatically; remove a heading’s ID to leave it out.

The Custom headers are <div> elements inside the <header> of the header template part. Their breakpoint is defined once as $header-breakpoint in the SCSS and exported as the CSS custom property --header-breakpoint, which the JavaScript reads at runtime. Change it in one place only.