Merge "Add help link to three rather important pages"
[lhc/web/wiklou.git] / resources / src / mediawiki.less / mediawiki.ui / mixins.less
1 // ----------------------------------------------------------------------------
2 // Form styling mixins
3 // ----------------------------------------------------------------------------
4 .agora-label-styling() {
5 font-size: 0.9em;
6 color: @colorText;
7
8 * {
9 font-weight: normal;
10 }
11 }
12
13 .agora-inline-label-styling() {
14 margin-bottom: 0.5em;
15 cursor: pointer;
16 vertical-align: bottom;
17 line-height: normal;
18
19 font-weight: normal;
20
21 & > input[type="checkbox"],
22 & > input[type="radio"] {
23 width: auto;
24 height: auto;
25 margin: 0 0.1em 0 0;
26 padding: 0;
27 border: 1px solid @colorFieldBorder;
28 cursor: pointer;
29 }
30 }
31
32 // ----------------------------------------------------------------------------
33 // Button styling
34 // ----------------------------------------------------------------------------
35
36 .button-colors(@bgColor) {
37 background: @bgColor;
38
39 &:hover {
40 // The inner bottom bevel should match the active background color.
41 box-shadow: 0 1px rgba(0, 0, 0, 10%), inset 0 -3px rgba(0, 0, 0, 20%);
42 border-bottom-color: mix(#000, @bgColor, 20%);
43 }
44
45 &:focus {
46 border-color: rgba(0,0,0,0.2);
47 box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2);
48
49 outline: none;
50 // remove outline in Firefox
51 &::-moz-focus-inner {
52 border-color: transparent;
53 }
54 }
55
56 &:active,
57 &.mw-ui-checked {
58 // lessphp doesn't implement shade (https://github.com/leafo/lessphp/issues/528);
59 // it passes it through, then ResourceLoader drops it.
60 // background: shade(@bgColor, 20%);
61 background: mix(#000, @bgColor, 20%);
62 box-shadow: none;
63 }
64 }
65
66 .button-colors(@bgColor) when (lightness(@bgColor) >= 70%) {
67 color: @colorButtonText;
68 border: 1px solid @colorGray12;
69
70 &:hover,
71 &:active,
72 &:visited {
73 // make sure that is isn't inheriting from a general rule
74 color: @colorButtonText;
75 }
76
77 &:disabled {
78 color: @colorDisabledText;
79
80 // make sure disabled buttons don't have hover and active states
81 &:hover,
82 &:active {
83 background: @bgColor;
84 box-shadow: none;
85 }
86 }
87 }
88
89 .button-colors(@bgColor) when (lightness(@bgColor) < 70%) {
90 color: #fff;
91 // border of the same color as background so that light background and
92 // dark background buttons are the same height and width
93 border: 1px solid @bgColor;
94 text-shadow: 0 1px rgba(0, 0, 0, .1);
95
96 &:disabled {
97 background: @colorGray13;
98 border-color: @colorGray13;
99
100 // make sure disabled buttons don't have hover and active states
101 &:hover,
102 &:active,
103 &.mw-ui-checked {
104 box-shadow: none;
105 }
106 }
107 }
108
109 .button-colors-quiet(@textColor) {
110 // Quiet buttons all start gray, and reveal
111 // constructive/progressive/destructive color on hover and active.
112 color: @colorButtonText;
113
114 &:hover,
115 &:focus {
116 color: @textColor;
117 }
118
119 &:active,
120 &.mw-ui-checked {
121 // lessphp doesn't implement shade, see above
122 // color: shade(@textColor, 20%);
123 color: mix(#000, @textColor, 20%);
124 }
125
126 &:disabled {
127 color: @colorDisabledText;
128 }
129 }