Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Styling layout blocks

CSS for pages built with the layouts editor: the class names the shipped templates emit (slb, slb-zone, ngl-block, ngl-vt-*), the grid stylesheet, spacing between blocks, blocks that adapt to narrow zones, and dark mode…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/designers/theme-design/styling-layout-blocks.md

On this page

Styling layout blocks

This page is for designers who write the CSS of layouts pages. It answers: which classes the templates give you, how to space and size blocks, and how to make one block look right in a wide and a narrow zone.

Contents

  1. The classes you get
  2. The grid stylesheet
  3. Spacing between blocks
  4. Blocks in narrow zones
  5. Light, dark and right to left

The classes you get

The shipped templates of extension/explayouts/design/standard/templates/explayouts/ emit:

ElementClasses and attributes
layoutslb (plus slb-2-column and the like in layout type templates), data-layout-id
zoneslb-zone, data-zone-identifier; in layout type templates also sevenx-zone sevenx-zone-<name>
blockslb slb-<definition> (slb-title, slb-list), data-block-id
container blocksngl-block ngl-two-columns, with container, row and col-md-* columns

Designs that override the templates choose their own classes; the media and starter designs keep the class names of the theme they were ported from. Look at the template path comments of a page to see which template drew a block (Debugging a design).

The grid stylesheet

The media design loads explayouts_standard/grid.css (from the layouts extension's design/standard/stylesheets/) before its own CSS, for the container, row and col-* classes. If your design draws containers with its own grid (CSS grid or flex), you do not need it.

Spacing between blocks

Give blocks vertical rhythm in one place:

.slb-zone > * + * { margin-block-start: var(--site-space-5); }

instead of margins inside each block template. Editors then can stack any blocks without odd gaps.

Blocks in narrow zones

The same list block may sit in a wide main zone and in a narrow sidebar. Use container queries on the zone:

.slb-zone { container-type: inline-size; }
.slb-list .block-list { display: grid; gap: var(--site-space-3); }
@container (min-width: 40rem) {
  .slb-list .block-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

Light, dark and right to left

  • Colors from tokens only, so blocks follow dark mode (Design tokens).
  • Logical properties, so two-column and image-with-text blocks mirror in right-to-left languages (Logical CSS properties).
  • Hero blocks with text on images: check contrast in both themes (Color contrast).

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x