Skip to content

Commit

Permalink
Add .grid__auto (#874)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronshekey authored Mar 14, 2022
1 parent 7408934 commit 31a5459
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/_data/grid.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@
"output": "grid-template-columns: repeat(1, minmax(0, 12fr))",
"define": "Creates a grid layout with 12 columns",
"responsive": true
},
{
"class": "grid__auto",
"output": "grid-template-columns: auto 1fr",
"define": "Creates a grid layout with auto-sized columns based on their content",
"responsive": true
}
],
"columns": [
Expand Down
10 changes: 9 additions & 1 deletion docs/product/base/grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@
<div class="d-grid grid__10"></div>
<div class="d-grid grid__11"></div>
<div class="d-grid grid__12"></div>
<div class="d-grid grid__auto"></div>
{% endhighlight %}
<div class="stacks-preview--example ff-mono">
<div class="mb16 d-grid g16 grid__1">
Expand Down Expand Up @@ -418,7 +419,7 @@
<div class="grid--item bg-black-075 p12 ba bc-black-3">11</div>
</div>

<div class="d-grid g16 grid__12">
<div class="mb32 d-grid g16 grid__12">
<div class="grid--item bg-black-075 p12 ba bc-black-3">1</div>
<div class="grid--item bg-black-075 p12 ba bc-black-3">2</div>
<div class="grid--item bg-black-075 p12 ba bc-black-3">3</div>
Expand All @@ -432,6 +433,13 @@
<div class="grid--item bg-black-075 p12 ba bc-black-3">11</div>
<div class="grid--item bg-black-075 p12 ba bc-black-3">12</div>
</div>

<div class="d-grid g16 grid__auto">
<div class="grid--item bg-black-075 p12 ba bc-black-3">1</div>
<div class="grid--item bg-black-075 p12 ba bc-black-3">2</div>
<div class="grid--item bg-black-075 p12 ba bc-black-3">3</div>
<div class="grid--item bg-black-075 p12 ba bc-black-3">4</div>
</div>
</div>
</div>
</section>
Expand Down
1 change: 1 addition & 0 deletions lib/css/atomic/_stacks-grid.less
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#stacks-internals #responsify('.grid__10', { grid-template-columns: repeat(10, minmax(0, 1fr)); });
#stacks-internals #responsify('.grid__11', { grid-template-columns: repeat(11, minmax(0, 1fr)); });
#stacks-internals #responsify('.grid__12', { grid-template-columns: repeat(12, minmax(0, 1fr)); });
#stacks-internals #responsify('.grid__auto', { grid-template-columns: auto 1fr; });

// ============================================================================
// $ COLUMN SPANS
Expand Down

0 comments on commit 31a5459

Please sign in to comment.