Merge "Add window close warning to Special:Upload"
[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 // Browsers that do not support either of these selectors will degrade to text only.
20 //
21 // Styleguide 4.
22
23 .mw-ui-icon {
24 position: relative;
25 min-height: @iconSize;
26 min-width: @iconSize;
27
28 // Standalone icons
29 //
30 // Markup:
31 // <div class="mw-ui-icon mw-ui-icon-element mw-ui-icon-ok">OK</div>
32 // <div class="mw-ui-icon mw-ui-icon-element mw-ui-icon-ok mw-ui-button mw-ui-progressive">OK</div>
33 //
34 // Styleguide 4.1.1.
35 &.mw-ui-icon-element {
36 @width: @iconSize + ( 2 * @gutterWidth );
37
38 text-indent: -999px;
39 overflow: hidden;
40 width: @width;
41 min-width: @width;
42 max-width: @width;
43 &:before {
44 left: 0;
45 right: 0;
46 position: absolute;
47 margin: 0 @gutterWidth;
48 }
49 }
50
51 &:before {
52 background-position: 50% 50%;
53 float: left;
54 display: block;
55 background-repeat: no-repeat;
56 background-size: 100% auto;
57 position: relative;
58 min-height: @iconSize;
59 content: '';
60 }
61
62
63 // Icons with text
64 //
65 // Markup:
66 // <div class="mw-ui-icon mw-ui-icon-before mw-ui-icon-ok">OK</div>
67 // <div class="mw-ui-icon mw-ui-icon-before mw-ui-icon-ok mw-ui-progressive mw-ui-button">OK</div>
68 //
69 // Styleguide 4.1.2
70 &.mw-ui-icon-before {
71 &:before {
72 width: @iconSize;
73 margin-right: @gutterWidth;
74 }
75 }
76 }
77
78 // Icons
79 .mw-ui-icon-ok {
80 .mixin-mw-ui-icon-bgimage('images/ok.svg', 'images/ok.png');
81 }