Sha256: 56343a696db43118353ead8fa835779f5176c1d5b8223bdaa94f5ddfc0aaaac6

Contents?: true

Size: 1.79 KB

Versions: 38

Compression:

Stored size: 1.79 KB

Contents

//************************************************************************//
// Background property for adding multiple backgrounds using shorthand
// notation.
//************************************************************************//

@mixin background($backgrounds...) {
  @include _bourbon-deprecate-for-prefixing("background");

  $webkit-backgrounds: ();
  $spec-backgrounds: ();

  @each $background in $backgrounds {
    $webkit-background: ();
    $spec-background: ();
    $background-type: type-of($background);

    @if $background-type == string or $background-type == list {
      $background-str: if($background-type == list, nth($background, 1), $background);

      $url-str:       str-slice($background-str, 1, 3);
      $gradient-type: str-slice($background-str, 1, 6);

      @if $url-str == "url" {
        $webkit-background: $background;
        $spec-background:   $background;
      }

      @else if $gradient-type == "linear" {
        $gradients: _linear-gradient-parser("#{$background}");
        $webkit-background: map-get($gradients, webkit-image);
        $spec-background:   map-get($gradients, spec-image);
      }

      @else if $gradient-type == "radial" {
        $gradients: _radial-gradient-parser("#{$background}");
        $webkit-background: map-get($gradients, webkit-image);
        $spec-background:   map-get($gradients, spec-image);
      }

      @else {
        $webkit-background: $background;
        $spec-background:   $background;
      }
    }

    @else {
      $webkit-background: $background;
      $spec-background:   $background;
    }

    $webkit-backgrounds: append($webkit-backgrounds, $webkit-background, comma);
    $spec-backgrounds:   append($spec-backgrounds,   $spec-background,   comma);
  }

  background: $webkit-backgrounds;
  background: $spec-backgrounds;
}

Version data entries

38 entries across 38 versions & 6 rubygems

Version Path
cortex-0.1.3 spec/dummy/node_modules/bourbon/app/assets/stylesheets/css3/_background.scss
english_tea-0.6.2 vendor/assets/stylesheets/bourbon/css3/_background.scss
english_tea-0.6.1 vendor/assets/stylesheets/bourbon/css3/_background.scss
english_tea-0.6.0 vendor/assets/stylesheets/bourbon/css3/_background.scss
english_tea-0.5.3 vendor/assets/stylesheets/bourbon/css3/_background.scss
english_tea-0.5.2 vendor/assets/stylesheets/bourbon/css3/_background.scss
english_tea-0.5.1 vendor/assets/stylesheets/bourbon/css3/_background.scss
english_tea-0.5.0 vendor/assets/stylesheets/bourbon/css3/_background.scss
english_tea-0.4.0 vendor/assets/stylesheets/bourbon/css3/_background.scss
english_tea-0.3.0 vendor/assets/stylesheets/bourbon/css3/_background.scss
wayfarer-jruby-0.0.3 docs/_sass/vendor/bourbon/css3/_background.scss
wayfarer-0.0.3 docs/_sass/vendor/bourbon/css3/_background.scss
wayfarer-jruby-0.0.2 docs/_sass/vendor/bourbon/css3/_background.scss
wayfarer-jruby-0.0.1 docs/_sass/vendor/bourbon/css3/_background.scss
bourbon-4.3.4 app/assets/stylesheets/css3/_background.scss
dta_rapid-0.3.5 _sass/vendor/bourbon/css3/_background.scss
dta_rapid-0.3.4 _sass/vendor/bourbon/css3/_background.scss
dta_rapid-0.3.3 _sass/vendor/bourbon/css3/_background.scss
dta_rapid-0.3.2 _sass/vendor/bourbon/css3/_background.scss
dta_rapid-0.3.1 _sass/vendor/bourbon/css3/_background.scss