Layout
Module Grid
Experience a responsive, adaptable layout framework with ModulateCSS's Module Grid.
ModulateCSS's Module Grid simplifies the management of both standard and unique layout scenarios, such as full bleed images, one-side bleeds, padded frames around content, and more.
The key feature is the ability to implement countless layout modifications by merely adjusting classes on the grid element—without altering the DOM structure or touching child elements. This seamless integration makes the Module Grid ideal for any CMS, streamlining web design and development.
The Grid
The following image shows the module grid with all relevant details. In addition to the content area typically handled by traditional grids, the module grid introduces a frame around the content. In addition, the column gaps are displayed as split columns to make the gaps themselves addressable for layouts.
Basic Column & Row Line Names
The names of the columns and rows of the module grid shown are listed below. These can be addressed when positioning grid cells.
Columns
screen-start
&screen-end
padding-start
&padding-end
frame-start
&frame-end
col-start
n
&col-end
n
(n = 1 to 12 or -1 to -12)gap
n
(n = 1 to 11 or -1 to -11)
Rows
screen-start
&screen-end
frame-start
&frame-end
row-start
n
&row-end
n
(n = 1 to x or -1 to -x)
Setup
First you need to add the following settings to your theme.css
file, if you want to override the default values.
Using the Grid
Basic Usage
Create a container with the module-grid
class.
Content Placement
The child elements inside the page grid can be easily placed by using the given line names. Since all lines are addressable, you have the freedom to implement almost any layout you can imagine easily.
Reverse Layouts
Simply use the reverse
class to mirror your layout.
This way you never need to implement mirrored layouts.
This reduces your work by half.
Vertical Spacing
Add the following custom properties to your theme.css
to configure the available vertical spacings for your module grids, if you want to override the default values.
You can apply the following classes to the module-grid
elements.
- Padding Block Start (Top):
ps-
+xs
,sm
,md
,lg
,xl
or2xl
- Padding Block End (Bottom):
pe-
+xs
,sm
,md
,lg
,xl
or2xl
- Margin Block Start (Top):
ms-
+xs
,sm
,md
,lg
,xl
or2xl
- Margin Block End (Bottom):
me-
+xs
,sm
,md
,lg
,xl
or2xl
The number of different sizes is limited to ensure that the vertical appearance of the web pages is harmonious.
Just add the given classes as needed to get your desired spacing.
Custom Row Definitions
While the column configuration should typically remain constant across the entire website, the row configuration is usually individual for each module type. For this reason, only one content row is provided by default in the module grid, the height of which automatically adapts to the given content.
If you need to implement more complex layouts, simply define --module-grid-rows
as needed to display your desired layout.
You can easily change your row setting for different layouts with additional classes.