Merge "Disable browser provided autocomplete function in TitleInputWidget"
[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, @highlightColor, @activeColor) {
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: @highlightColor;
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 background: @activeColor;
59 box-shadow: none;
60 }
61 }
62
63 .button-colors(@bgColor, @highlightColor, @activeColor) when (lightness(@bgColor) >= 70%) {
64 color: @colorButtonText;
65 border: 1px solid @colorGray12;
66
67 &:hover,
68 &:active,
69 &:visited {
70 // make sure that is isn't inheriting from a general rule
71 color: @colorButtonText;
72 }
73
74 &:disabled {
75 color: @colorDisabledText;
76
77 // make sure disabled buttons don't have hover and active states
78 &:hover,
79 &:active {
80 background: @bgColor;
81 box-shadow: none;
82 }
83 }
84 }
85
86 .button-colors(@bgColor, @highlightColor, @activeColor) when (lightness(@bgColor) < 70%) {
87 color: #fff;
88 // border of the same color as background so that light background and
89 // dark background buttons are the same height and width
90 border: 1px solid @bgColor;
91 text-shadow: 0 1px rgba(0, 0, 0, .1);
92
93 &:disabled {
94 background: @colorGray13;
95 border-color: @colorGray13;
96
97 // make sure disabled buttons don't have hover and active states
98 &:hover,
99 &:active,
100 &.mw-ui-checked {
101 box-shadow: none;
102 }
103 }
104 }
105
106 .button-colors-quiet(@textColor, @highlightColor, @activeColor) {
107 // Quiet buttons all start gray, and reveal
108 // constructive/progressive/destructive color on hover and active.
109 color: @colorButtonText;
110
111 &:hover,
112 &:focus {
113 color: @textColor;
114 }
115
116 &:active,
117 &.mw-ui-checked {
118 color: @activeColor;
119 }
120
121 &:disabled {
122 color: @colorDisabledText;
123 }
124 }