// it need set the real path

@function -compass-space-list($list) {
  $n : length($list);
  $res : nth($list, 1);
  @for $i from 2 to $n + 1 {
    $res : $res + ' ' + nth($list, $i);
  }
  @return unquote($res);
}

@function font-url($url) {
  $url : $compass-font-path + $url;
  @return unquote("url('") + $url + unquote("')"); 
}

@function font-files($url, $format) {
  $url : $compass-font-path + $url;
  @return unquote("url('") + $url + unquote("')") + unquote(" format('") + $format + unquote("')");
}

@function stylesheet-url($url) {
  $url : $compass-stylesheet-path + $url;
  @return unquote("url('") + $url + unquote("')");
}

@function image-url($url) {
  @if str-index($url, '/') == 1 { @return unquote("url('") + $url + unquote("')"); }
  @if str-index($url, 'http') == 1 { @return unquote("url(") + $url + unquote(")"); }
  $url : $compass-image-path + $url;
  @return unquote("url('") + $url + unquote("')");
}

@function -compass-list-size($list) {
  @return length($list);
}

@function prefixed($type, $list) {
  $m : length($list);
  @for $j from 1 to $m + 1 {
    $background : nth($list, $j);
    $n : length($background);
    @for $i from 1 to $n + 1 {
      $cur : nth($background, $i);
      @if type-of($cur) == string {
        @if str-index($cur, 'linear-gradient(') == 1
          or str-index($cur, 'radial-gradient(') == 1 { 
            @return true; 
          }
      }
    }
  }
  @return false;
}

@function elements-of-type($type) {
  @if $type == html5-block {
    @return article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary;
  }
  @if $type == inline {
    @return a, abbr, acronym, audio, b , basefont, bdo, big, br, canvas, cite, code, command, datalist, dfn, em, embed, font, i, img, input, keygen, kbd, label, mark, meter, output, progress, q, rp, rt, ruby, s, samp, select, small, span, strike, strong, sub, sup, textarea, time, tt, u, var, video, wbr;
  }
  @if $type == block {
    @return address, article, aside, blockquote, center, dir, div, dd, details, dl, dt, fieldset, figcaption, figure, form, footer, frameset, h1, h2, h3, h4, h5, h6, hr, header, hgroup, isindex, menu, nav, noframes, noscript, ol, p, pre, section, summary, ul;
  }
}

@function append-selector($list, $selector) {
  $n : length($list);
  $res : compact(nth($list, 1) + $selector);
  @for $i from 2 to $n + 1 {
    $res : join($res, compact(nth($list, $i) + $selector));
  }
  @return $res;
}

@function is-url($url) {
  @if str-index($url, http) != null or str-index($url, '/') != null {
    @return true;
  }
  @return false;
}

@function opposite-position($pos) {
  @if $pos == top { @return bottom; }
  @if $pos == right { @return left; }
  @if $pos == bottom { @return bottom; }
  @if $pos == left { @return right; }
}


@function strip-units($number) {
  @return $number / ($number * 0 + 1);
}