Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Document flex-grow-0 and flex-shrink-0
  • Loading branch information
simurai committed Jul 16, 2019
commit 57483c05f31c808bc6ba37aa4a81ca893ea13c1d
28 changes: 26 additions & 2 deletions pages/css/utilities/flexbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,13 +472,17 @@ When the main axis wraps, this creates multiple main axis lines and adds extra s

Use this class to specify the ability of a flex item to alter its dimensions to fill available space.

```CSS
.flex-auto { flex: 1 1 auto; }
```css
.flex-auto { flex: 1 1 auto; }
.flex-grow-0 { flex-grow: 0; }
.flex-shrink-0 { flex-shrink: 0; }
```

| Class | Description |
| --- | --- |
| `.flex-auto` | Sets default values for `flex-grow` (1), `flex-shrink` (1) and `flex-basis` (auto) |
| `.flex-grow-0` | Reset `flex-grow` to 0 |
| `.flex-shrink-0` | Reset `flex-shrink` to 0 |

#### flex-auto

Expand All @@ -490,6 +494,26 @@ Use this class to specify the ability of a flex item to alter its dimensions to
</div>
```

#### flex-grow-0

```html
<div class="border d-flex">
<div class="p-5 border bg-gray-light flex-auto">.flex-auto</div>
<div class="p-5 border bg-gray-light flex-auto flex-grow-0">.flex-auto .flex-grow-0</div>
<div class="p-5 border bg-gray-light flex-auto">.flex-auto</div>
</div>
```

#### flex-shrink-0

```html
<div class="border d-flex">
<div class="p-5 border bg-gray-light flex-auto">.flex-auto</div>
<div class="p-5 border bg-gray-light flex-auto flex-shrink-0">.flex-auto .flex-shrink-0</div>
<div class="p-5 border bg-gray-light flex-auto">.flex-auto</div>
</div>
```

## Align self

Use these classes to adjust the alignment of an individual flex item on the cross axis. This overrides any `align-items` property applied to the flex container.
Expand Down