Sha256: 3eadbba1bca09de584c5daa78d613718501a33aa29dfdbe8ad09e1efcd09f21a

Contents?: true

Size: 1.83 KB

Versions: 15

Compression:

Stored size: 1.83 KB

Contents

// Browser Support
// ===============

// Susy Support Defaults
// ---------------------
@include susy-defaults((
  use-custom: (
    clearfix: false,
    background-image: true,
    background-options: false,
    breakpoint: true,
    box-sizing: true,
    rem: true,
  ),
));


// Susy Support [mixin]
// --------------------
// Send property-value pairs to the proper support modules.
// - $prop  : <css property>
// - $val   : <css value>
@mixin susy-support(
  $prop,
  $val
) {
  // Background Support
  @if $prop == background-image {
    @include susy-background-image($val);
  } @else if $prop == background-size {
    @include susy-background-size($val);
  } @else if $prop == background-origin {
    @include susy-background-origin($val);
  } @else if $prop == background-clip {
    @include susy-background-clip($val);
  }

  // Box-Sizing Support
  @else if $prop == box-sizing {
    @include susy-box-sizing($val);
  }

  // Rem Support
  @else {
    @include susy-rem($prop, $val);
  }
}


// Susy Support [function]
// -----------------------
// Check for support of a feature.
// - $feature       : <string>
//                    - e.g "rem" or "box-sizing"
// - $requirements  : <map>
//                    - e.g (variable: rem-with-px-fallback, mixin: rem)
// - $warn          : <bool>
@function susy-support(
  $feature,
  $requirements: (),
  $warn: true
) {
  $_support: susy-get(use-custom $feature);

  @if $_support {
    $_fail: false;

    @each $_type, $_req in $requirements {
      @each $_i in $_req {
        $_pass: call(#{$_type}-exists, $_i);

        @if not($_pass) {
          $_fail: true;
          @if $warn {
            @warn "You requested custom support of #{$feature}, but the #{$_i} #{$_type} is not available.";
          }
        }
      }
    }

    $_support: if($_fail, false, $_support);
  }

  @return $_support;
}

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
susy-2.2.9 sass/susy/output/support/_support.scss
susy-2.2.8 sass/susy/output/support/_support.scss
susy-2.2.7 sass/susy/output/support/_support.scss
ghost-manager-1.0.0 magneto/source/assets/bower_components/susy/sass/susy/output/support/_support.scss
susy-2.2.6 sass/susy/output/support/_support.scss
mifflin-0.1.1 vendor/assets/bower_components/susy/sass/susy/output/support/_support.scss
susy-2.2.5 sass/susy/output/support/_support.scss
susy-2.2.4 sass/susy/output/support/_support.scss
susy-2.2.3 sass/susy/output/support/_support.scss
susy-2.2.2 sass/susy/output/support/_support.scss
susy-2.2.2.alpha.1 sass/susy/output/support/_support.scss
susy-2.2.1 sass/susy/output/support/_support.scss
susy-2.2.0.rc.2 sass/susy/output/support/_support.scss
susy-2.2.0.rc.1 sass/susy/output/support/_support.scss
susy-2.2.0.beta.3 sass/susy/output/support/_support.scss