The ECL uses an abridged version of the Bootstrap 12 column grid as the basic underlying structure for all web pages. The grid is composed of a set of columns, rows and containers used for aligning the content as well as the general layout.
The grid:
- Containers are required when using our default grid system as they are the most basic layout elements, representing a means to horizontally align components or content elements - this is done by invoking
.ecl-container
- The column classes express the number of columns to be engaged out of the maximum, which is 12 per row (e.g. an element invoking
.ecl-col-2
occupies two columns) - Container widths and breakpoints are expressed in pixels
- Each column has horizontal padding (gutter) for regulating the space between them
- The gutters are expressed in rems
- The width of the columns is always proportional to the container width, which is fixed (except for viewports <480px), and they are expressed in percentages
- The rows wrap around the columns, allowing you to specify the amount of columns content wraps around
ECL Grid Options
The grid's breakpoints are established on the minimum width media queries, therefore the are applied on the targeted breakpoint and all those above it.
viewport | Extra small (≥ 0px) | Small (≥ 480px) | Medium (≥ 768px) | Large (≥ 996px) | Extra large (≥ 1140px) |
---|---|---|---|---|---|
container width | 100% | 480px | 768px | 996px | 1140px |
class prefix | .ecl-col- | .ecl-col-sm- | .ecl-col-md- | .ecl-col-lg- | .ecl-col-xl- |
ECL Grid Examples
<div class="ecl-container">
<div class="ecl-row">
<div class="ecl-col-2">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-2</div>
</div>
<div class="ecl-col-2">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-2</div>
</div>
<div class="ecl-col-2">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-2</div>
</div>
<div class="ecl-col-2">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-2</div>
</div>
<div class="ecl-col-2">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-2</div>
</div>
<div class="ecl-col-2">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-2</div>
</div>
</div>
<div class="ecl-row ecl-u-mt-m">
<div class="ecl-col-3">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-3</div>
</div>
<div class="ecl-col-3">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-3</div>
</div>
<div class="ecl-col-3">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-3</div>
</div>
<div class="ecl-col-3">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-3</div>
</div>
</div>
<div class="ecl-row ecl-u-mt-m">
<div class="ecl-col-4">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-4</div>
</div>
<div class="ecl-col-4">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-4</div>
</div>
<div class="ecl-col-4">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-4</div>
</div>
</div>
<div class="ecl-row ecl-u-mt-m">
<div class="ecl-col-6">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-6</div>
</div>
<div class="ecl-col-6">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-6</div>
</div>
</div>
<div class="ecl-row ecl-u-mt-m">
<div class="ecl-col-12">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-12</div>
</div>
</div>
</div>
Try it yourself on the playground
Playground<div class="ecl-container">
<div class="ecl-row">
<div class="ecl-col-6">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-6</div>
</div>
<div class="ecl-col-4">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-4</div>
</div>
<div class="ecl-col-2">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-2</div>
</div>
</div>
</div>
Try it yourself on the playground
Playground<div class="ecl-container">
<div class="ecl-row">
<div class="ecl-col-2">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-2</div>
</div>
<div class="ecl-col-8">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-8</div>
</div>
<div class="ecl-col-2">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-2</div>
</div>
</div>
</div>
Try it yourself on the playground
Playground<div class="ecl-container">
<div class="ecl-row">
<div class="ecl-col-3">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-3</div>
</div>
<div class="ecl-col-3">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-3</div>
</div>
<div class="ecl-col-6">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-6</div>
</div>
</div>
</div>
Try it yourself on the playground
PlaygroundGrid offset
When using the ECL grid, there is the ability to offset columns. You can offset columns from left to right by invoking the .ecl-offset-*
classes (where * = the number of columns). These classes simply increase the left margin by * number of columns.
<div class="ecl-container">
<div class="ecl-row">
<div class="ecl-col-4">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-4</div>
</div>
</div>
<div class="ecl-row ecl-u-mt-m">
<div class="ecl-col-4 ecl-offset-4">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-4 .ecl-offset-4</div>
</div>
</div>
<div class="ecl-row ecl-u-mt-m">
<div class="ecl-col-4 ecl-offset-8">
<div
class="ecl-u-pa-xs ecl-u-bg-blue-25 ecl-u-border-all ecl-u-border-color-blue ecl-u-type-color-blue ecl-u-type-l ecl-u-type-bold">
.ecl-col-4 .ecl-offset-8</div>
</div>
</div>
</div>
Try it yourself on the playground
PlaygroundDo's
- always place content within columns
- specify the exact amount of columns content must occupy
- use
.ecl-offset-*
grid classes for offsetting content
Don'ts
- don't use margin to offset content