Sha256: 342cae5ee57cf80efbb6f695adbb155d15b3392fb856817efe7346591f7710d9

Contents?: true

Size: 1.8 KB

Versions: 51

Compression:

Stored size: 1.8 KB

Contents

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

// Susy Support Defaults
// ---------------------
@include susy-defaults((
  use-custom: (
    clearfix: false,
    background-image: true,
    background-options: false,
    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

51 entries across 51 versions & 2 rubygems

Version Path
wrgem-0.0.55 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.54 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.53 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.52 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.51 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.50 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.49 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.48 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.47 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.46 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.45 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.44 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.43 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.42 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.41 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.40 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.39 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.38 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.37 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss
wrgem-0.0.35 lib/generators/wrstart/template/vendor/assets/components/susy/sass/susy/output/support/_support.scss