Merge "PrefixSearch: Add unit tests for StringPrefixSearch"
[lhc/web/wiklou.git] / resources / src / mediawiki.ui / components / icons.less
1 @import "mediawiki.mixins";
2
3 // Variables
4 @iconSize: 1.4em;
5 @gutterWidth: 1em;
6
7 // Mixins
8 .mixin-mw-ui-icon-bgimage(@iconSvg, @iconPng) {
9 &.mw-ui-icon:before {
10 .background-image-svg(@iconSvg, @iconPng);
11 }
12 }
13
14 // Icons
15 //
16 // To use icons you must be using a browser that supports pseudo elements.
17 // This includes support for IE8.
18 // http://caniuse.com/#feat=css-gencontent
19 //
20 // For elements that are intended to have both an icon and text, browsers that
21 // do not support pseudo-selectors will degrade to text-only.
22 //
23 // However, icon-only elements do not yet degrade to text-only elements in these
24 // browsers.
25 //
26 // Styleguide 4.
27
28 .mw-ui-icon {
29 position: relative;
30 min-height: @iconSize;
31 min-width: @iconSize;
32
33 // Standalone icons
34 //
35 // Markup:
36 // <div class="mw-ui-icon mw-ui-icon-element mw-ui-icon-ok">OK</div>
37 // <div class="mw-ui-icon mw-ui-icon-element mw-ui-icon-ok mw-ui-button mw-ui-progressive">OK</div>
38 //
39 // Styleguide 4.1.1.
40 &.mw-ui-icon-element {
41 @width: @iconSize + ( 2 * @gutterWidth );
42
43 text-indent: -999px;
44 overflow: hidden;
45 width: @width;
46 min-width: @width;
47 max-width: @width;
48 &:before {
49 left: 0;
50 right: 0;
51 position: absolute;
52 margin: 0 @gutterWidth;
53 }
54 }
55
56 &:before {
57 background-position: 50% 50%;
58 float: left;
59 display: block;
60 background-repeat: no-repeat;
61 background-size: 100% auto;
62 position: relative;
63 min-height: @iconSize;
64 content: '';
65 }
66
67
68 // Icons with text
69 //
70 // Markup:
71 // <div class="mw-ui-icon mw-ui-icon-before mw-ui-icon-ok">OK</div>
72 // <div class="mw-ui-icon mw-ui-icon-before mw-ui-icon-ok mw-ui-progressive mw-ui-button">OK</div>
73 //
74 // Styleguide 4.1.2
75 &.mw-ui-icon-before {
76 &:before {
77 width: @iconSize;
78 margin-right: @gutterWidth;
79 }
80 }
81 }
82
83 // Icons
84 .mw-ui-icon-ok {
85 .mixin-mw-ui-icon-bgimage('images/ok.svg', 'images/ok.png');
86 }