Skip to content

Commit

Permalink
tec: Provide a .row--wrap class
Browse files Browse the repository at this point in the history
  • Loading branch information
marien-probesys committed May 9, 2023
1 parent 4aa8a10 commit b370ad0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
18 changes: 18 additions & 0 deletions assets/stylesheets/utils/flow.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,21 @@
margin-left: var(--flow-size);
}
}

.flow-smaller.row--always.row--wrap > *,
.flow-small.row--always.row--wrap > *,
.flow.row--always.row--wrap > *,
.flow-large.row--always.row--wrap > *,
.flow-larger.row--always.row--wrap > * {
margin-bottom: var(--flow-size);
}

@media (min-width: 800px) {
.flow-smaller.row--wrap > *,
.flow-small.row--wrap > *,
.flow.row--wrap > *,
.flow-large.row--wrap > *,
.flow-larger.row--wrap > * {
margin-bottom: var(--flow-size);
}
}
4 changes: 4 additions & 0 deletions assets/stylesheets/utils/rows.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
justify-content: center;
}

.row--wrap {
flex-wrap: wrap;
}

.row__item--extend {
flex: 1;
}
Expand Down
14 changes: 14 additions & 0 deletions docs/developers/rows-and-grids.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ To add space between row items, just use one of the `.flow*` classes:
</div>
```

In certain cases, you may want the items of the row to be placed on a new line.
This can be done with `.row--wrap`:

```html
<div class="row row--wrap">
<div>A</div>
<div>Lot</div>
<div>Of</div>
<div>Items</div>
</div>
```

Before using this class, please consider the grid system first.

You can tell a row item to take all the remaining space with `.row__item--extend`:

```html
Expand Down

0 comments on commit b370ad0

Please sign in to comment.