Merge "Escape message 'redirectto' in Article"
[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 &:focus {
41 // The inner bottom bevel should match the active background color.
42 box-shadow: 0 1px rgba(0, 0, 0, 10%), inset 0 -3px rgba(0, 0, 0, 20%);
43 border-bottom-color: mix(#000, @bgColor, 20%);
44 outline: none;
45 // remove outline in Firefox
46 &::-moz-focus-inner {
47 border-color: transparent;
48 }
49 }
50
51 &:active,
52 &.mw-ui-checked {
53 // lessphp doesn't implement shade (https://github.com/leafo/lessphp/issues/528);
54 // it passes it through, then ResourceLoader drops it.
55 // background: shade(@bgColor, 20%);
56 background: mix(#000, @bgColor, 20%);
57 box-shadow: none;
58 }
59 }
60
61 .button-colors(@bgColor) when (lightness(@bgColor) >= 70%) {
62 color: @colorButtonText;
63 border: 1px solid @colorGray12;
64
65 &:hover,
66 &:active,
67 &:visited {
68 // make sure that is isn't inheriting from a general rule
69 color: @colorButtonText;
70 }
71
72 &:disabled {
73 color: @colorDisabledText;
74
75 // make sure disabled buttons don't have hover and active states
76 &:hover,
77 &:active {
78 background: @bgColor;
79 box-shadow: none;
80 }
81 }
82 }
83
84 .button-colors(@bgColor) when (lightness(@bgColor) < 70%) {
85 color: #fff;
86 // border of the same color as background so that light background and
87 // dark background buttons are the same height and width
88 border: 1px solid @bgColor;
89 text-shadow: 0 1px rgba(0, 0, 0, .1);
90
91 &:disabled {
92 background: @colorGray13;
93 border-color: @colorGray13;
94
95 // make sure disabled buttons don't have hover and active states
96 &:hover,
97 &:active,
98 &.mw-ui-checked {
99 box-shadow: none;
100 }
101 }
102 }
103
104 .button-colors-quiet(@textColor) {
105 // Quiet buttons all start gray, and reveal
106 // constructive/progressive/destructive color on hover and active.
107 color: @colorButtonText;
108
109 &:hover,
110 &:focus {
111 // lessphp doesn't implement tint, see above
112 // color: tint(@textColor, 20%);
113 color: mix(#fff, @textColor, 20%);
114 }
115
116 &:active,
117 &.mw-ui-checked {
118 // lessphp doesn't implement shade, see above
119 // color: shade(@textColor, 20%);
120 color: mix(#000, @textColor, 20%);
121 }
122
123 &:disabled {
124 color: @colorDisabledText;
125 }
126 }