/* ==========================================================================
   CORE SETTINGS
   ========================================================================== */

/**
 * This file sets up normandy-css most important variables.
 * These values should be defined soon and be modified with caution.
 */

/* stylelint-disable scss/dollar-variable-colon-space-after */



/**
 * Baseline grid lines height.
 * Every spacing metric should be based on this.
 */

$global-baseline: 6px !default;





/**
 * How many grid lines should our spacing unit variants span?
 * Each value should be an unitless integer.
 */

$unit-factor-tiny:   1 !default;   // 6px
$unit-factor-small:  2 !default;   // 12px
$unit-factor:        4 !default;   // 24px
$unit-factor-large:  8 !default;   // 48px
$unit-factor-huge:  16 !default;   // 96px





/**
 * This will give us variables to create spacing values such as padding and
 * margin utilities and mantain vertical rythm across the project.
 *
 * It is not recommended that you modify these following variables
 * (it can break your vertical rhythm).
 */

$global-spacing-unit-tiny:  $global-baseline * $unit-factor-tiny !default;
$global-spacing-unit-small: $global-baseline * $unit-factor-small !default;
$global-spacing-unit:       $global-baseline * $unit-factor !default;
$global-spacing-unit-large: $global-baseline * $unit-factor-large !default;
$global-spacing-unit-huge:  $global-baseline * $unit-factor-huge !default;





/**
 * Base typographical styles and baseline grid. Make sure you define these
 * values in pixels: they will converted to more appropriate units.
 */

$global-font-size: 16px !default;
$global-line-height: $global-spacing-unit !default;


/* stylelint-enable scss/dollar-variable-colon-space-after */





/* ==========================================================================
   DO NOT MODIFY ANYTHING BELOW THIS POINT
   ========================================================================== */


// Check that the chosen font rules are pixel numbers.

@each $_font-globals in $global-font-size $global-line-height {

  @if (type-of($_font-globals) == number) {

    @if (unit($_font-globals) != "px") {
      @error "`#{$_font-globals}` needs to be a pixel value.";
    }

  } @else {
    @error "`#{$_font-globals}` needs to be a number.";
  }

}


// Check that the chosen size factors are unitless, integer numbers.

@each $_spacing-unit in
  $unit-factor-tiny
  $unit-factor-small
  $unit-factor-large
  $unit-factor-huge {

  @if (type-of($_spacing-unit) == number) {

    @if (unitless($_spacing-unit) == false) {
      @error "`#{$_spacing-unit}` needs to be unitless.";
    }

    @if ($_spacing-unit != ceil($_spacing-unit)) {
      @error "`#{$_spacing-unit}` needs to be an integer.";
    }

  } @else {
    @error "`#{$_spacing-unit}` needs to be a number.";
  }

}
