Sha256: a61e2a90ed52b51b832cf28dd8587634e49155130bc8a1202384b9b331e1eaac

Contents?: true

Size: 1.74 KB

Versions: 17

Compression:

Stored size: 1.74 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 $background-type == 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

17 entries across 16 versions & 7 rubygems

Version Path
soffes-blog-jekyll-0.2.0 _sass/bourbon/css3/_background.scss
soffes-blog-jekyll-0.1.0 _sass/bourbon/css3/_background.scss
va_common-0.1.0 app/assets/stylesheets/lib/bourbon/css3/_background.scss
us_web_design_standards-0.0.2 assets/_scss/lib/bourbon/css3/_background.scss
us_web_design_standards-0.0.2 app/assets/stylesheets/lib/bourbon/css3/_background.scss
us_web_design_standards-0.0.0 assets/_scss/lib/bourbon/css3/_background.scss
solidus_backend-1.0.0.pre3 vendor/bundle/gems/bourbon-4.2.3/app/assets/stylesheets/css3/_background.scss
nesta-contentfocus-extensions-0.0.3 assets/stylesheets/bourbon/css3/_background.scss
nesta-contentfocus-extensions-0.0.2 assets/stylesheets/bourbon/css3/_background.scss
solidus_backend-1.0.0.pre2 vendor/bundle/gems/bourbon-4.2.3/app/assets/stylesheets/css3/_background.scss
mifflin-0.1.1 vendor/assets/bower_components/bourbon/app/assets/stylesheets/css3/_background.scss
bourbon-4.2.3 app/assets/stylesheets/css3/_background.scss
bourbon-4.2.2 app/assets/stylesheets/css3/_background.scss
bourbon-4.2.1 app/assets/stylesheets/css3/_background.scss
bourbon-4.2.0 app/assets/stylesheets/css3/_background.scss
bourbon-4.2.0.beta app/assets/stylesheets/css3/_background.scss
bourbon-4.2.0.pre app/assets/stylesheets/css3/_background.scss