Sha256: 2f50ecb8a26b0dd0facb8e75bd61383514092b8a11be67f8796a471a51a04e1b

Contents?: true

Size: 1.25 KB

Versions: 91

Compression:

Stored size: 1.25 KB

Contents

@function _radial-gradient-parser($image) {
  $image: unquote($image);
  $gradients: ();
  $start: str-index($image, "(");
  $end: str-index($image, ",");
  $first-val: str-slice($image, $start + 1, $end - 1);

  $prefix: str-slice($image, 0, $start);
  $suffix: str-slice($image, $end, str-length($image));

  $is-spec-syntax: str-index($first-val, "at");

  @if $is-spec-syntax and $is-spec-syntax > 1 {
    $keyword: str-slice($first-val, 1, $is-spec-syntax - 2);
    $pos: str-slice($first-val, $is-spec-syntax + 3, str-length($first-val));
    $pos: append($pos, $keyword, comma);

    $gradients: (
      webkit-image: -webkit- + $prefix + $pos + $suffix,
      spec-image: $image
    )
  }

  @else if $is-spec-syntax == 1 {
    $pos: str-slice($first-val, $is-spec-syntax + 3, str-length($first-val));

    $gradients: (
      webkit-image: -webkit- + $prefix + $pos + $suffix,
      spec-image: $image
    )
  }

  @else if str-index($image, "cover") or str-index($image, "contain") {
    @warn "Radial-gradient needs to be updated to conform to latest spec.";

    $gradients: (
      webkit-image: null,
      spec-image: $image
    )
  }

  @else {
    $gradients: (
      webkit-image: -webkit- + $image,
      spec-image: $image
    )
  }

  @return $gradients;
}

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