]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Merge branch 'develop' into refactor/xy-cell
authorNicolas Coden <nicolas@ncoden.fr>
Tue, 4 Sep 2018 21:43:37 +0000 (23:43 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Tue, 4 Sep 2018 21:43:37 +0000 (23:43 +0200)
1  2 
docs/pages/xy-grid.md
scss/xy-grid/_position.scss

Simple merge
index 8acd7918ae0df4beb8f074601e50c2bf67dd8b7b,336275de5bdfb3bdec4e919b3634843611991e08..f20a07c05d2756229f286d7951f45513e18d0eb4
@@@ -6,37 -6,12 +6,37 @@@
  /// @group xy-grid
  ////
  
-     $offset: calc(#{$size} + #{$gutter});
 +/// Returns the appropriate CSS value to offset a cell.
 +///
 +/// @param {Number|List} $n - Size to offset by. You can pass in any value accepted by the `xy-cell()` mixin, such as `6`, `50%`, or `1 of 2`.
 +/// @param {Number|Map} $gutters [$grid-margin-gutters] Map of gutters or single value to use for responsive gutters.
 +/// @param {Keyword} $gutter-type [margin] The type of gutter to use. Can be `margin` or `padding`
 +/// @param {String} $breakpoint [null] - The name of the breakpoint size in your gutters map to get the size from. If using with the `breakpoint()` mixin this will be set automatically unless manually entered.
 +///
 +/// @returns {Number|String} The cell offset property value.
 +@function xy-cell-offset(
 +  $n,
 +  $gutters: $grid-margin-gutters,
 +  $gutter-type: margin,
 +  $breakpoint: null
 +) {
 +  $breakpoint: -zf-current-breakpoint($breakpoint, $default: $-zf-zero-breakpoint);
 +  $size: xy-cell-size($n);
 +
 +  $offset: $size;
 +  @if ($gutter-type == 'margin') {
 +    $gutter: rem-calc(xy-cell-gutters($gutters, $breakpoint) / 2);
++    $offset: if($gutter == 0, $size, calc(#{$size} + #{$gutter}));
 +  }
 +  @return $offset;
 +}
 +
  /// Offsets a column to the right/bottom by `$n` columns.
  ///
 -/// @param {Number|List} $n - Size to offset by. You can pass in any value accepted by the `zf-cell()` mixin, such as `6`, `50%`, or `1 of 2`.
 +/// @param {Number|List} $n - Size to offset by. You can pass in any value accepted by the `xy-cell()` mixin, such as `6`, `50%`, or `1 of 2`.
  /// @param {Number|Map} $gutters [$grid-margin-gutters] Map of gutters or single value to use for responsive gutters.
  /// @param {Keyword} $gutter-type [margin] The type of gutter to use. Can be `margin` or `padding`
 -/// @param {Number|Array|Keyword} $breakpoint [$-zf-zero-breakpoint] - Single value, breakpoint name, or list of breakpoint names to use for `$gutters`. See `-zf-breakpoint-value()`.
 +/// @param {Number|Array|Keyword} $breakpoint [null] - Breakpoint to use for `$gutters`. It can be a breakpoint name, list of breakpoints or `auto` for all breakpoints. If a list is given, media-queries will be generated. If using with the `breakpoint()` mixin this will be set automatically unless manually entered.
  /// @param {Boolean} $vertical [false] Sets the direction of the offset. If set to true will apply margin-top instead.
  @mixin xy-cell-offset(
   $n,