Refactor reporting dir
[releng.git] / utils / test / reporting / 3rd_party / sass / libs / _mixins.scss
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
5 \r
6         text-decoration: none;\r
7 \r
8         &:#{$where} {\r
9 \r
10                 @if $content {\r
11                         content: $content;\r
12                 }\r
13 \r
14                 -moz-osx-font-smoothing: grayscale;\r
15                 -webkit-font-smoothing: antialiased;\r
16                 font-family: FontAwesome;\r
17                 font-style: normal;\r
18                 font-weight: normal;\r
19                 text-transform: none !important;\r
20 \r
21         }\r
22 \r
23 }\r
24 \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
31 \r
32         @if $important {\r
33                 $important: '!important';\r
34         }\r
35 \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
37 \r
38 }\r
39 \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
44 \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
53 \r
54         @return url("data:image/svg+xml;charset=utf8,#{$svg}");\r
55 \r
56 }