/// makes sections stacked
@mixin top-bar-stacked() {
+ // Sub-sections
.top-bar-right {
width: 100%;
}
}
}
-/// unstack sections
-@mixin top-bar-unstack() {
- .top-bar-right {
- width: auto;
- }
- .top-bar-left {
- width: auto;
- }
-}
@mixin foundation-top-bar {
// Top bar container
.top-bar {
@include top-bar-container;
}
- // Stack on medium screens smaller
- .stacked-for-medium {
- @include breakpoint(medium down) {
- @include top-bar-stacked;
+ // generate classes for stacking on each screen size (defined in $breakpoint-classes)
+ @each $size in $breakpoint-classes {
+ .stacked-for-#{$size} {
+ @include breakpoint($size down) {
+ @include top-bar-stacked;
+ }
}
}
- // Stack on small screens
- .stacked,
- .stacked-for-small {
- @include breakpoint(small) {
- @include top-bar-stacked;
- }
- @include breakpoint(medium) {
- @include top-bar-unstack;
- }
+ // stack on small screens as default
+ @include breakpoint(small down) {
+ @include top-bar-stacked;
}
// Sub-sections