/* -------------------------------------------------- */
/*    #GRID
/*    More Infos about the 8 PX GRID here
/*    URL: https://spec.fm/specifics/8-pt-grid
/* -------------------------------------------------- */

$dh-pixelGrid:            true; // Use Pixelgrid
$dh-pixelGridSize:        8px; // Pixelgrid Size
$dh-columns:              12; // Number of Columns
$dh-columnWidth:          120px; // Column Width
$dh-gutterWidth:          8px; // Gutter width on each side
$dh-gutterWidthMin:       $dh-gutterWidth;
$dh-gutterWidthMax:       $dh-gutterWidth * 2;

/*--------------------------------------------------
    #DON'T EDIT BELOW HERE
  --------------------------------------------------*/

// Check Pixel Grid Settings and round up to the next possible Value
@if $dh-pixelGrid {

  // Round Numbers
  $dh-roundWidth:   round($dh-columnWidth / $dh-pixelGridSize);
  $dh-roundGutter:  round($dh-gutterWidth / $dh-pixelGridSize);

  // Check if the Numbers are equal
  $dh-checkWidth:   $dh-roundWidth != $dh-columnWidth / $dh-pixelGridSize;
  $dh-checkGutter:  $dh-roundGutter != $dh-gutterWidth / $dh-pixelGridSize;

  @if $dh-checkWidth or $dh-checkGutter {

    $dh-columnWidth:  $dh-roundWidth * $dh-pixelGridSize;
    $dh-gutterWidth:  $dh-roundGutter * $dh-pixelGridSize;

  } @else {

    $dh-columnWidth:  $dh-columnWidth;
    $dh-gutterWidth:  $dh-gutterWidth

  }

} @else {

  $dh-columnWidth:  $dh-columnWidth;
  $dh-gutterWidth:  $dh-gutterWidth

}

// Set max-width
$dh-maxWidth: $dh-columnWidth * $dh-columns;
