@include xy-gutters($gutter, $gutter-type, $gutter-position);
}
}
-
-/// Modifies a cell to give it "block" behavior (overflow auto, inertial scrolling)
-///
-/// @param {Boolean} $vertical [false] - Is grid vertical or horizontal. Should match grid.
-@mixin xy-cell-block(
- $vertical: false
-) {
- $property: if($vertical == true, 'overflow-y', 'overflow-x');
-
- @if $vertical == true {
- overflow-y: auto;
- max-height: 100%;
- } @else {
- overflow-x: auto;
- max-width: 100%;
- }
-
- -webkit-overflow-scrolling: touch;
- -ms-overflow-stype: -ms-autohiding-scrollbar;
-}
-
-/// Container for inside a grid frame containing multiple blocks. Typically used
-/// as a modifier for a `.cell` to allow the cell to pass along flex sizing
-/// constraints / from parents to children.
-@mixin xy-cell-block-container() {
- display: flex;
- flex-direction: column;
- max-height: 100%;
-
- > .grid {
- max-height: 100%;
- }
-}
@include xy-grid;
}
- // Framed grid styles
- .grid-frame {
- @include xy-grid-frame;
- }
-
.cell {
@include xy-cell-base();
@include xy-cell-static($grid-columns, false, $gutter-type: padding);
}
-
- .cell-block {
- @include xy-cell-block();
- }
-
- .cell-block-container {
- @include xy-cell-block-container();
- }
-
.grid {
> .auto {
@include xy-cell-base(auto);
@include xy-cell-static(shrink, false);
}
- &.#{$-zf-size}-grid-frame {
- width: auto;
- @include xy-grid-frame(true);
- }
- .#{$-zf-size}-cell-block {
- @include xy-cell-block();
- }
}
@for $i from 1 through $grid-columns {
$padding-grid: true
) {
- .cell-block-vertical {
- @include xy-cell-block(true);
- }
-
@include -zf-each-breakpoint() {
@if not($-zf-size == small) {
- .#{$-zf-size}-cell-block-vertical {
- @include xy-cell-block(true);
- }
}
}
.grid-vertical {
@include xy-grid(vertical);
- &.grid-frame {
- width: auto;
- @include xy-grid-frame(true);
- }
-
> .cell {
@include xy-cell-reset();
@include xy-cell-static(shrink, false, $breakpoint: $-zf-size, $vertical: true);
}
- &.#{$-zf-size}-grid-frame {
- width: auto;
- @include xy-grid-frame(true);
- }
}
@for $i from 1 through $grid-columns {
}
}
+@mixin xy-frame-grid-classes($vertical-grid: true) {
+ // Framed grid styles
+ .grid-frame {
+ @include xy-grid-frame;
+ }
+
+ .cell-block {
+ @include xy-cell-block();
+ }
+
+
+ .cell-block-container {
+ @include xy-cell-block-container();
+ }
+
+
+ @include -zf-each-breakpoint(false) {
+
+ .#{$-zf-size}-grid-frame {
+ width: auto;
+ @include xy-grid-frame(true);
+ }
+ .#{$-zf-size}-cell-block {
+ @include xy-cell-block();
+ }
+ }
+
+ @if $vertical-grid {
+
+ .cell-block-vertical {
+ @include xy-cell-block(true);
+ }
+
+ .grid-vertical {
+ &.grid-frame {
+ width: auto;
+ @include xy-grid-frame(true);
+ }
+
+ @include -zf-each-breakpoint(false) {
+ &.#{$-zf-size}-grid-frame {
+ width: auto;
+ @include xy-grid-frame(true);
+ }
+
+ .#{$-zf-size}-cell-block-vertical {
+ @include xy-cell-block(true);
+ }
+ }
+ }
+ }
+
+}
+
// Final classes
@mixin foundation-xy-grid-classes(
$base-grid: true,
$block-grid: true,
$collapse: true,
$offset: true,
- $vertical-grid: true
+ $vertical-grid: true,
+ $frame-grid: true
) {
// Base grid styles
@if($vertical-grid) {
@include xy-vertical-grid-classes($margin-grid, $padding-grid);
}
+
+ @if ($frame-grid) {
+ @include xy-frame-grid-classes($vertical-grid)
+ }
}
--- /dev/null
+/// Modifies a grid to give it "frame" behavior (no overflow, no wrap, stretch behavior)
+///
+/// @param {Boolean} $vertical [false] - Is grid vertical or horizontal. Should match grid.
+/// @param {Boolean} $nested [false] - Is grid nested or not. If nested is true this sets the frame to 100% height, otherwise will be 100vh.
+@mixin xy-grid-frame(
+ $vertical: false,
+ $nested: false
+) {
+
+ @if $vertical == true {
+ height: if($nested == true, 100%, 100vh);
+ } @else {
+ width: if($nested == true, 100%, 100vw);
+ }
+
+ overflow: hidden;
+ position: relative;
+ flex-wrap: nowrap;
+ align-items: stretch;
+}
+
+/// Modifies a cell to give it "block" behavior (overflow auto, inertial scrolling)
+///
+/// @param {Boolean} $vertical [false] - Is grid vertical or horizontal. Should match grid.
+@mixin xy-cell-block(
+ $vertical: false
+) {
+ $property: if($vertical == true, 'overflow-y', 'overflow-x');
+
+ @if $vertical == true {
+ overflow-y: auto;
+ max-height: 100%;
+ } @else {
+ overflow-x: auto;
+ max-width: 100%;
+ }
+
+ -webkit-overflow-scrolling: touch;
+ -ms-overflow-stype: -ms-autohiding-scrollbar;
+}
+
+/// Container for inside a grid frame containing multiple blocks. Typically used
+/// as a modifier for a `.cell` to allow the cell to pass along flex sizing
+/// constraints / from parents to children.
+@mixin xy-cell-block-container() {
+ display: flex;
+ flex-direction: column;
+ max-height: 100%;
+
+ > .grid {
+ max-height: 100%;
+ }
+}
display: flex;
flex-flow: $direction $wrap;
}
-
-
-/// Modifies a grid to give it "frame" behavior (no overflow, no wrap, stretch behavior)
-///
-/// @param {Boolean} $vertical [false] - Is grid vertical or horizontal. Should match grid.
-/// @param {Boolean} $nested [false] - Is grid nested or not. If nested is true this sets the frame to 100% height, otherwise will be 100vh.
-@mixin xy-grid-frame(
- $vertical: false,
- $nested: false
-) {
-
- @if $vertical == true {
- height: if($nested == true, 100%, 100vh);
- } @else {
- width: if($nested == true, 100%, 100vw);
- }
-
- overflow: hidden;
- position: relative;
- flex-wrap: nowrap;
- align-items: stretch;
-}
@import 'gutters';
@import 'grid';
@import 'cell';
+@import 'frame';
@import 'position';
@import 'layout';
@import 'collapse';