1 /// Makes an element's :before pseudoelement a FontAwesome icon.
\r
2 /// @param {string} $content Optional content value to use.
\r
3 /// @param {string} $where Optional pseudoelement to target (before or after).
\r
4 @mixin icon($content: false, $where: before) {
\r
6 text-decoration: none;
\r
14 -moz-osx-font-smoothing: grayscale;
\r
15 -webkit-font-smoothing: antialiased;
\r
16 font-family: FontAwesome;
\r
18 font-weight: normal;
\r
19 text-transform: none !important;
\r
25 /// Applies padding to an element, taking the current element-margin value into account.
\r
26 /// @param {mixed} $tb Top/bottom padding.
\r
27 /// @param {mixed} $lr Left/right padding.
\r
28 /// @param {list} $pad Optional extra padding (in the following order top, right, bottom, left)
\r
29 /// @param {bool} $important If true, adds !important.
\r
30 @mixin padding($tb, $lr, $pad: (0,0,0,0), $important: null) {
\r
33 $important: '!important';
\r
36 padding: ($tb + nth($pad,1)) ($lr + nth($pad,2)) max(0.1em, $tb - _size(element-margin) + nth($pad,3)) ($lr + nth($pad,4)) #{$important};
\r
40 /// Encodes a SVG data URL so IE doesn't choke (via codepen.io/jakob-e/pen/YXXBrp).
\r
41 /// @param {string} $svg SVG data URL.
\r
42 /// @return {string} Encoded SVG data URL.
\r
43 @function svg-url($svg) {
\r
45 $svg: str-replace($svg, '"', '\'');
\r
46 $svg: str-replace($svg, '<', '%3C');
\r
47 $svg: str-replace($svg, '>', '%3E');
\r
48 $svg: str-replace($svg, '&', '%26');
\r
49 $svg: str-replace($svg, '#', '%23');
\r
50 $svg: str-replace($svg, '{', '%7B');
\r
51 $svg: str-replace($svg, '}', '%7D');
\r
52 $svg: str-replace($svg, ';', '%3B');
\r
54 @return url("data:image/svg+xml;charset=utf8,#{$svg}");
\r