1 @import "mediawiki.mixins";
2 @import "mediawiki.ui/variables";
3 @import "mediawiki.ui/mixins";
7 // All buttons start with mw-ui-button class, modified by other classes.
8 // It can be any element. Due to a lack of a CSS reset, the exact styling of
9 // the button depends on what type of element is used.
10 // There are two kinds of buttons, the default is a "Call to Action" with an obvious border
11 // and there is a quiet kind without a border.
15 @buttonBorderRadius: 3px;
16 @transitionDuration: .1s;
17 @transitionFunction: ease-in-out;
19 // Neutral button styling
22 // <button class="mw-ui-button">.mw-ui-button</button>
23 // <button class="mw-ui-button" disabled>.mw-ui-button</button>
27 // Inherit the font rather than apply user agent stylesheet (bug 70072)
31 display: inline-block;
34 .box-sizing(border-box);
36 // Disable weird iOS styling
37 -webkit-appearance: none;
40 // http://stackoverflow.com/a/5838575/365238
46 border-radius: @buttonBorderRadius;
48 // Ensure that buttons and inputs are nicely aligned when they have differing heights
49 vertical-align: middle;
55 // Interaction styling
63 .transition(background @transitionDuration @transitionFunction, color @transitionDuration @transitionFunction, box-shadow @transitionDuration @transitionFunction;);
65 // Styling for specific button types
66 // -----------------------------------------
70 // Not all buttons are equal. You can emphasise certain actions over others
71 // using the mw-ui-big class.
74 // <button class="mw-ui-button mw-ui-big">.mw-ui-button</button>
75 // <button class="mw-ui-button mw-ui-progressive mw-ui-big">.mw-ui-progressive</button>
76 // <button class="mw-ui-button mw-ui-constructive mw-ui-big">.mw-ui-constructive</button>
77 // <button class="mw-ui-button mw-ui-destructive mw-ui-big">.mw-ui-destructive</button>
86 // Some buttons might need to be stacked.
89 // <button class="mw-ui-button mw-ui-block">.mw-ui-button</button>
90 // <button class="mw-ui-button mw-ui-progressive mw-ui-block">.mw-ui-progressive</button>
91 // <button class="mw-ui-button mw-ui-constructive mw-ui-block">.mw-ui-constructive</button>
92 // <button class="mw-ui-button mw-ui-destructive mw-ui-block">.mw-ui-destructive</button>
100 // Progressive buttons
102 // Use progressive buttons for actions which lead to a next step in the process.
103 // .mw-ui-primary is deprecated, kept for compatibility.
106 // <button class="mw-ui-button mw-ui-progressive">.mw-ui-progressive</button>
107 // <button class="mw-ui-button mw-ui-progressive" disabled>.mw-ui-progressive</button>
112 .button-colors(@colorProgressive);
115 .button-colors-quiet(@colorProgressive);
119 // Constructive buttons
121 // Use constructive buttons for actions which result in a final action in the process that results
122 // in a change of state.
123 // e.g. save changes button
126 // <button class="mw-ui-button mw-ui-constructive">.mw-ui-constructive</button>
127 // <button class="mw-ui-button mw-ui-constructive" disabled>.mw-ui-constructive</button>
130 &.mw-ui-constructive {
131 .button-colors(@colorConstructive);
134 .button-colors-quiet(@colorConstructive);
138 // Destructive buttons
140 // Use destructive buttons for actions which result in the destruction of data.
141 // e.g. deleting a page.
142 // This should not be used for cancel buttons.
145 // <button class="mw-ui-button mw-ui-destructive">.mw-ui-destructive</button>
146 // <button class="mw-ui-button mw-ui-destructive" disabled>.mw-ui-destructive</button>
149 &.mw-ui-destructive {
150 .button-colors(@colorDestructive);
153 .button-colors-quiet(@colorDestructive);
159 // Use quiet buttons when they are less important and alongisde other progressive/destructive/progressive buttons.
162 // <button class="mw-ui-button mw-ui-quiet">.mw-ui-button</button>
163 // <button class="mw-ui-button mw-ui-constructive mw-ui-quiet">.mw-ui-constructive</button>
164 // <button class="mw-ui-button mw-ui-constructive mw-ui-quiet" disabled>.mw-ui-constructive</button>
165 // <button class="mw-ui-button mw-ui-destructive mw-ui-quiet">.mw-ui-destructive</button>
166 // <button class="mw-ui-button mw-ui-destructive mw-ui-quiet" disabled>.mw-ui-destructive</button>
167 // <button class="mw-ui-button mw-ui-progressive mw-ui-quiet">.mw-ui-progressive</button>
168 // <button class="mw-ui-button mw-ui-progressive mw-ui-quiet" disabled>.mw-ui-progressive</button>
172 background: transparent;
175 .button-colors-quiet(@colorButtonText);
184 background: transparent;
190 text-decoration: none;
192 // This overrides an underline declaration on a:hover and a:focus in
193 // commonElements.css, which the class alone isn't specific enough to do.
196 text-decoration: none;
202 // Group of buttons. Make sure you clear the floating after using a mw-ui-button-group.
205 // <div class="mw-ui-button-group">
206 // <div class="mw-ui-button">A</div>
207 // <div class="mw-ui-button">B</div>
208 // <div class="mw-ui-button">C</div>
209 // <div class="mw-ui-button">D</div>
210 // </div><div style="clear:both"></div>
213 .mw-ui-button-group > * {
218 border-top-left-radius: @buttonBorderRadius;
219 border-bottom-left-radius: @buttonBorderRadius;
222 &:not(:first-child) {
227 border-top-right-radius: @buttonBorderRadius;
228 border-bottom-right-radius: @buttonBorderRadius;