@import "project-setup";
@import "compass/support";
@import "compass/css3/flexbox";

@function unprefixed-at-version($browser, $capability) {
  $options: if($capability == flexbox, $flexbox-capability-options, $default-capability-options);
  @each $version in browser-versions($browser) {
    @if not browser-requires-prefix($browser, $version, $capability, $options) {
      @return $version;
    }
  }
  @return null;
}
@each $browser in browsers() {
  $prefix: browser-prefix($browser);
  .#{$browser} {
    $versions: browser-versions($browser);
    versions: $versions;
    @each $capability in browser-capabilities() {
      $options: if($capability == flexbox, $flexbox-capability-options, $default-capability-options);
      @if browser-requires-prefix($browser, nth($versions, 1), $capability, $options) {
        @if prefix-usage($prefix, $capability, $options) > 0.1 {
          #{$capability}: $prefix;
        } @else {
          #{$capability}: prefix-no-longer-needed;
        }
        #{$capability}-unprefixed-at: unprefixed-at-version($browser, $capability);
      }
    }
  }
}
