Sha256: 555b67270f0c29105067d356785b3ccf132d35bdf2c2f2e0545c746fca3a98a6

Contents?: true

Size: 1.66 KB

Versions: 7

Compression:

Stored size: 1.66 KB

Contents

/// Makes an element's :before pseudoelement a FontAwesome icon.
/// @param {string} $content Optional content value to use.
/// @param {string} $where Optional pseudoelement to target (before or after).
@mixin icon($content: false, $where: before) {

  text-decoration: none;

  &:#{$where} {

    @if $content {
      content: $content;
    }

    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    font-family: FontAwesome;
    font-style: normal;
    font-weight: normal;
    text-transform: none !important;
  }
}

/// Applies padding to an element, taking the current element-margin value into account.
/// @param {mixed} $tb Top/bottom padding.
/// @param {mixed} $lr Left/right padding.
/// @param {list} $pad Optional extra padding (in the following order top, right, bottom, left)
/// @param {bool} $important If true, adds !important.
@mixin padding($tb, $lr, $pad: (0,0,0,0), $important: null) {

  @if $important {
    $important: '!important';
  }

  padding: ($tb + nth($pad,1)) ($lr + nth($pad,2)) max(0.1em, $tb - _size(element-margin) + nth($pad,3)) ($lr + nth($pad,4)) #{$important};
}

/// Encodes a SVG data URL so IE doesn't choke (via codepen.io/jakob-e/pen/YXXBrp).
/// @param {string} $svg SVG data URL.
/// @return {string} Encoded SVG data URL.
@function svg-url($svg) {
  $svg: str-replace($svg, '"', '\'');
  $svg: str-replace($svg, '<', '%3C');
  $svg: str-replace($svg, '>', '%3E');
  $svg: str-replace($svg, '&', '%26');
  $svg: str-replace($svg, '#', '%23');
  $svg: str-replace($svg, '{', '%7B');
  $svg: str-replace($svg, '}', '%7D');
  $svg: str-replace($svg, ';', '%3B');

  @return url("data:image/svg+xml;charset=utf8,#{$svg}");
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
phantom-blergh-0.2.0 _sass/phantom-blergh/libs/_mixins.scss
phantom-blergh-0.1.5 _sass/phantom-blergh/libs/_mixins.scss
phantom-blergh-0.1.4 _sass/phantom-blergh/libs/_mixins.scss
phantom-blergh-0.1.3 _sass/phantom-blergh/libs/_mixins.scss
phantom-blergh-0.1.2 _sass/phantom-blergh/libs/_mixins.scss
phantom-blergh-0.1.1 _sass/phantom-blergh/libs/_mixins.scss
phantom-blergh-0.1.0 _sass/phantom-blergh/libs/_mixins.scss