Sha256: e1e87fb3001525441fcbc00b6e0be59d174cb51325190098c5dfc7aecd23d9b1

Contents?: true

Size: 1.78 KB

Versions: 91

Compression:

Stored size: 1.78 KB

Contents

@mixin border-image($borders...) {
  $webkit-borders: ();
  $spec-borders: ();

  @each $border in $borders {
    $webkit-border: ();
    $spec-border: ();
    $border-type: type-of($border);

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

      $url-str:       str-slice($border-str, 0, 3);
      $gradient-type: str-slice($border-str, 0, 6);

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

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

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

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

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

    $webkit-borders: append($webkit-borders, $webkit-border, comma);
    $spec-borders:   append($spec-borders,   $spec-border,   comma);
  }

  -webkit-border-image: $webkit-borders;
          border-image: $spec-borders;
          border-style: solid;
}

//Examples:
// @include border-image(url("image.png"));
// @include border-image(url("image.png") 20 stretch);
// @include border-image(linear-gradient(45deg, orange, yellow));
// @include border-image(linear-gradient(45deg, orange, yellow) stretch);
// @include border-image(linear-gradient(45deg, orange, yellow) 20 30 40 50 stretch round);
// @include border-image(radial-gradient(top, cover, orange, yellow, orange));

Version data entries

91 entries across 86 versions & 10 rubygems

Version Path
wrgem-0.0.52 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss
wrgem-0.0.51 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss
wrgem-0.0.50 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss
wrgem-0.0.49 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss
wrgem-0.0.48 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss
wrgem-0.0.47 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss
wrgem-0.0.46 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss
wrgem-0.0.45 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss
wrgem-0.0.44 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss
thesis-0.1.3 app/assets/stylesheets/thesis/base/bourbon/css3/_border-image.scss
frozen-0.0.1 dummy/assets/stylesheets/bourbon/css3/_border-image.scss
bourbon-4.1.1 app/assets/stylesheets/css3/_border-image.scss
bourbon-4.1.0 app/assets/stylesheets/css3/_border-image.scss
bourbon-4.1.0.pre app/assets/stylesheets/css3/_border-image.scss
wrgem-0.0.43 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss
wrgem-0.0.42 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss
wrgem-0.0.41 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss
wrgem-0.0.40 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss
wrgem-0.0.39 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss
wrgem-0.0.38 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss