Skip to content

Commit 6dc18d5

Browse files
committed
docs(README): Add note about flex bug.
1 parent 8653c5c commit 6dc18d5

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

+33
Original file line numberDiff line numberDiff line change
@@ -239,3 +239,36 @@ Simply add a rule that causes the first item in the navigation to expand beyond
239239
}
240240
}
241241
```
242+
243+
## Troubleshooting
244+
245+
## Flex nav collapsing
246+
247+
If your menu is part of an auto-sized flex-child, it will probably need a positive `flex-grow` value to prevent it reverting to its smallest form. For instance:
248+
249+
```html
250+
<header class="site-header">
251+
<h1 class="site-header__title">My great site title</h1>
252+
<nav class="site-header__nav">
253+
<ul class="site-nav js-site-nav">
254+
<li><a href="#">Services</a></li>
255+
<li><a href="#">Thinking</a></li>
256+
<li><a href="#">Events</a></li>
257+
</ul>
258+
</nav>
259+
</header>
260+
```
261+
262+
```css
263+
.site-header {
264+
display: flex;
265+
align-items: center;
266+
}
267+
268+
/**
269+
* Prevents nav from collapsing.
270+
*/
271+
.site-header__nav {
272+
flex-grow: 1;
273+
}
274+
```

0 commit comments

Comments
 (0)