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
card-mod-bootstrap-0.18.1 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/css3/_border-image.scss
card-mod-bootstrap-0.18.0 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/css3/_border-image.scss
card-mod-bootstrap-0.17.0 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/css3/_border-image.scss
card-mod-bootstrap-0.16.0 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/css3/_border-image.scss
card-mod-bootstrap-0.15.6 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/css3/_border-image.scss
card-mod-bootstrap-0.15.5 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/css3/_border-image.scss
card-mod-bootstrap-0.15.4 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/css3/_border-image.scss
card-mod-bootstrap-0.15.3 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/css3/_border-image.scss
card-mod-bootstrap-0.15.1.2 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/css3/_border-image.scss
card-mod-bootstrap-0.15.2.pre1 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/css3/_border-image.scss
card-mod-bootstrap-0.15.1.1 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/css3/_border-image.scss
card-mod-bootstrap-0.15.1 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/css3/_border-image.scss
card-mod-bootstrap-0.15.0 vendor/select2/docs/themes/learn2/scss/vendor/bourbon/css3/_border-image.scss
portfolio-jekyll-theme-2.0.0 _sass/1-tools/bourbon/css3/_border-image.scss
hanuman-0.3.0 _sass/bourbon/css3/_border-image.scss
hanuman-0.2.0 _sass/bourbon/css3/_border-image.scss
hanuman-0.1.0 _sass/bourbon/css3/_border-image.scss
wrgem-0.0.55 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss
wrgem-0.0.54 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss
wrgem-0.0.53 lib/generators/wrstart/template/vendor/assets/components/bourbon/dist/css3/_border-image.scss