//reset spacing values
p, h1, h2, h3, h4, h5, h6, small
  margin 0
  padding 0

html
  font-family: 'Merriweather', serif
  color $text-color

h1, h2, h3, h4, h5, h6
  font-family: 'Montserrat', sans-serif
  font-weight 400

h1
  font-weight 700

// setup responsive baseline and vertical grid (when debugging)
$establish-baseline()

for $bp, $config in $bp-list
  if ($config.baseline isnt null)
    +$mq($bp)
      $establish-baseline(unit($config.baseline, px))
      if ($debug is true)
        $vertical-grid( unit(round($ms-ratio * $config.baseline), '') )

if ($debug is true)
  $vertical-grid(unit(round($ms-base * $ms-ratio), ''))

// set font size, leading, trailing, as configured
for $element, $config in $typography-list
  $selector = $element

  if ($config.class is null)
    $selector += ', .'+$element
  else
    if ($config.class isnt false)
      $selector += ', .'+$config.class

  {$selector}
    $leader($config.lead || 0)
    $trailer($config.trail || 0)

    if ($config['extra-lines'] isnt null)
      $font-size($config.size, $config['extra-lines'])
    else
      $font-size($config.size)

//reset spacing values
p, h1, h2, h3, h4, h5, h6, small
  margin 0
  padding 0

html
  font-family: 'Merriweather', serif
  color $text-color

h1, h2, h3, h4, h5, h6
  font-family: 'Montserrat', sans-serif
  font-weight 400

h1
  font-weight 700

// setup responsive baseline and vertical grid (when debugging)
$establish-baseline()

if ($debug is true)
  $vertical-grid(unit(round($ms-base * $ms-ratio), ''))

for $bp, $config in $bp-list
  if ($config.baseline isnt null)
    +$mq($bp)
      $establish-baseline(unit($config.baseline, px))
      if ($debug is true)
        $vertical-grid( unit(round($ms-ratio * $config.baseline), '') )


// set font size, leading, trailing, as configured
for $element, $config in $typography-list
  $selector = $element

  if ($config.class is null)
    $selector += ', .'+$element
  else
    if ($config.class isnt false)
      $selector += ', .'+$config.class

  {$selector}
    $leader($config.lead || 0)
    $trailer($config.trail || 0)

    if ($config['extra-lines'] isnt null)
      $font-size($config.size, $config['extra-lines'])
    else
      $font-size($config.size)

Fix source order of responsive baseline styles
Fix source order of responsive baseline styles
