#Grid
A light-weight abstraction developed as an alternative to the existing flexbox implementation.
Header
Sidebar
Main Content
Sub Content
Sub Content
Footer
By default, grid
is preset with 12 individual columns horizontally and vertically. That means that it is simple to partition the grid into 144 separate cells.
Different Grid Templates
Instead of the default 12-column layout, you can specify the grid template with the grid-cols-*
class. The asterisk represents any value from 1 through 12 inclusive.
grid-cols-1
grid-cols-2
grid-cols-2
grid-cols-3
grid-cols-3
grid-cols-3
grid-cols-4
grid-cols-4
grid-cols-4
grid-cols-4
I think you get the idea.
As an example, let's use a grid of 3 with the grid-cols-3
class.
1
2
3
4
5
6
7
8
9
<div class="grid grid-cols-3 grid-gap-3">
<div class="c">
<p>1</p>
</div>
<div class="c">
<p>2</p>
</div>
<div class="c">
<p>3</p>
</div>
<div class="c">
<p>4</p>
</div>
<div class="c">
<p>5</p>
</div>
<div class="c">
<p>6</p>
</div>
<div class="c">
<p>7</p>
</div>
<div class="c">
<p>8</p>
</div>
<div class="c">
<p>9</p>
</div>
</div>