Implement extension registration from an extension.json file
[mediawiki.git] / resources / src / mediawiki.less / mediawiki.ui / mixins.less
blob40a5c411d3bf08fb3995d0e1f674cdd6a5e836d8
1 // ----------------------------------------------------------------------------
2 // Form styling mixins
3 // ----------------------------------------------------------------------------
4 .agora-label-styling() {
5         font-size: 0.9em;
6         color: @colorText;
8         * {
9                 font-weight: normal;
10         }
13 .agora-inline-label-styling() {
14         margin-bottom: 0.5em;
15         cursor: pointer;
16         vertical-align: bottom;
17         line-height: normal;
19         font-weight: normal;
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         }
32 // ----------------------------------------------------------------------------
33 // Button styling
34 // ----------------------------------------------------------------------------
36 .button-colors(@bgColor) {
37         background: @bgColor;
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         }
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         }
61 .button-colors(@bgColor) when (lightness(@bgColor) >= 70%) {
62         color: @colorButtonText;
63         border: 1px solid @colorGray12;
65         &:hover,
66         &:active,
67         &:visited {
68                 // make sure that is isn't inheriting from a general rule
69                 color: @colorButtonText;
70         }
72         &:disabled {
73                 color: @colorDisabledText;
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         }
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);
91         &:disabled {
92                 background: @colorGray12;
93                 border-color: @colorGray12;
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         }
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;
109         &:hover,
110         &:focus {
111                 // lessphp doesn't implement tint, see above
112                 // color: tint(@textColor, 20%);
113                 color: mix(#fff, @textColor, 20%);
114         }
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         }
123         &:disabled {
124                 color: @colorDisabledText;
125         }