Skip to content

Commit

Permalink
feat: some bentos grid
Browse files Browse the repository at this point in the history
  • Loading branch information
Vattghern203 committed Dec 2, 2023
1 parent 8e33f3a commit eae2f2a
Show file tree
Hide file tree
Showing 4 changed files with 201 additions and 1 deletion.
42 changes: 42 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,48 @@ <h4>Scroll Gallery</h4>

</section>

<section>
<h3>Bentos</h3>

<p>A new trend at the time LOL</p>

<h4>Normal Bento(6)</h4>

<section class="small-bento">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
</section>

<h4>Normal Bento(6)</h4>

<section class="bento">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</section>

<h4>Big Bento(10)</h4>

<section class="big-bento">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
</section>

</section>

</main>
<a class="scroll-to-top" href=".hero">TOP</a>

Expand Down
96 changes: 96 additions & 0 deletions src/sass/utils/_display.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,102 @@
}
}

// Bento Grid -------------------------------------------------

:is(.big-bento, .small-bento, .bento) {

display: grid;
gap: var(--xs);
grid-auto-rows: 1fr;

& > * {
margin: 0;
align-self: stretch;
//aspect-ratio: 1;
background-color: black;
}

}

.small-bento {

aspect-ratio: 16 / 9;
grid-template-columns: repeat(3, 1fr);

& :nth-child(1) {

grid-row: span 3;
}

& :is(:nth-child(2), :nth-child(3)) {

grid-row: span 2;
grid-column: span 2;
}

& :nth-child(4) {

grid-column: span -1;
}
}

.bento {

aspect-ratio: 16 / 9;

grid-template-columns: repeat(4, 1fr);

& :nth-child(1) {

grid-row: span 2;
grid-column: span 2;
}

& :is(:nth-child(2), :nth-child(3)) {

grid-row: span 2;
}

& :is(:nth-child(5)) {

grid-column: span 2;
}
}

// A Bento with 10 items

.big-bento {

aspect-ratio: 16 / 9;

grid-template-columns: repeat(7, 1fr);

& :is(:nth-child(1), :nth-child(3)) {

grid-column: span 2;
}

& :nth-child(2) {

grid-column: span 3;
}

& :is(:nth-child(4), :nth-child(5), :nth-child(7), :nth-child(8)) {
grid-row: span 2;
}

& :nth-child(6) {

grid-row: span 3;
grid-column: span 3;
}

& :is(:nth-child(9), :nth-child(10)) {

grid-column: span 2;
}
}

// Wrapper

:where(.wrapper) {
Expand Down
62 changes: 62 additions & 0 deletions src/styles/yonaka.temps.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit eae2f2a

Please sign in to comment.