Sha256: 0ac26ec19dba74b0e027ec63a6ba94bea771bab1f01b23997d412188459e18c6

Contents?: true

Size: 1.72 KB

Versions: 87

Compression:

Stored size: 1.72 KB

Contents

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

@mixin background($backgrounds...) {
  $webkit-backgrounds: ();
  $spec-backgrounds: ();

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

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

      $url-str:       str-slice($background-str, 0, 3);
      $gradient-type: str-slice($background-str, 0, 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

87 entries across 82 versions & 9 rubygems

Version Path
wrgem-0.0.52 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.51 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.50 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.49 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.48 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.47 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.46 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.45 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.44 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
thesis-0.1.3 app/assets/stylesheets/thesis/base/bourbon/css3/_background.scss
wrgem-0.0.43 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.42 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.41 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.40 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.39 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.38 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.37 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.35 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.32 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss
wrgem-0.0.31 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_background.scss