Sha256: 8a5aaa265937ec0ab250c8fef13c5809f11868982dda896e56a1e77fd4507d12

Contents?: true

Size: 1.44 KB

Versions: 4

Compression:

Stored size: 1.44 KB

Contents

// SVG Grid Math
// =============



// SVG Column Position
// -------------------
/// Determine the proper horizontal position
/// for a column rectangle
///
/// @access private
///
/// @param {Integer} $column -
///   1-indexed column location on the grid
/// @param {Map} $grid -
///   Normalized settings map representing the current grid
///
/// @return {Length} -
///   Horizontal position of svg column rectangle,
///   as distance from the grid edge
@function _susy-svg-column-position(
  $column,
  $grid
) {
  $x: $column - 1;

  @if ($x > 0) {
    $x: susy-span(first $x wide, $grid);
  }

  @return $x;
}



// SVG Offset
// ----------
/// Determine if a grid image needs to be offset,
/// to account for edge gutters.
///
/// @access private
///
/// @param {Map} $grid -
///   Normalized settings map representing the current grid
///
/// @return {Length | null} -
///   Expected distance from container edge to first column,
///   based on spread values and gutter-widths
@function _susy-svg-offset(
  $grid
) {
  $columns: su-valid-columns(map-get($grid, 'columns'));
  $gutters: su-valid-gutters(map-get($grid, 'gutters'), $columns);
  $first: nth($columns, 1);

  @if (unitless($first)) and (not unitless($gutters)) {
    @return null;
  }

  $container: map-get($grid, 'container-spread');
  $span: map-get($grid, 'spread');
  $extra: $container - $span;

  @if $extra == 0 {
    @return null;
  }

  @return $extra * susy-gutter($config: $grid) / 2;
}



Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
susy-3.0.0.alpha.6 sass/plugins/svg-grid/_svg-grid-math.scss
susy-3.0.0.alpha.5 sass/plugins/svg-grid/_svg-grid-math.scss
susy-3.0.0.alpha.4 sass/plugins/svg-grid/_svg-grid-math.scss
susy-3.0.0.alpha.2 sass/plugins/svg-grid/_svg-grid-math.scss