<p>The features of Foundation 5's top bar are still around, but they've been reworked into smaller, individual plugins. Check out our page on <a href="responsive-navigation.html">responsive navigation</a> to learn more.</p>
</div>
+<div class="primary callout">
+ <p>This component supports flexbox mode. <a href="#">Learn how to enable flexbox mode</a>.</p>
+</div>
+
## Basics
A top bar (`.top-bar`) can have two sections: a left-hand section (`.top-bar-left`) and a right-hand section (`.top-bar-right`). On small screens, these sections stack on top of each other.
/// Adds styles for a top bar container.
@mixin top-bar-container {
- @include clearfix;
+ @if $global-flexbox {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ flex-wrap: nowrap;
+ }
+ @else {
+ @include clearfix;
+ }
+
padding: $topbar-padding;
&,
/// makes sections stacked
@mixin top-bar-stacked {
- // Sub-sections
- .top-bar-right {
- width: 100%;
+ @if $global-flexbox {
+ flex-wrap: wrap;
+
+ // Sub-sections
+ .top-bar-right {
+ flex: 0 0 100%;
+ max-width: 100%;
+ }
}
+ @else {
+ // Sub-sections
+ .top-bar-right {
+ width: 100%;
+ }
- .top-bar-left {
- width: 100%;
+ .top-bar-left {
+ width: 100%;
+ }
}
}
}
// Sub-sections
- .top-bar-left {
- float: left;
+ @if $global-flexbox {
+ .top-bar-left,
+ .top-bar-right {
+ flex: 0 0 auto;
+ }
}
-
- .top-bar-right {
- float: right;
+ @else {
+ .top-bar-left {
+ float: left;
+ }
+
+ .top-bar-right {
+ float: right;
+ }
}
}