1 @import "mediawiki.mixins";
2 @import "../../settings/typography";
3 @import "../../mixins/effects";
4 @import "../../mixins/utilities";
8 // All buttons start with mw-ui-button class, modified by other classes.
9 // It can be any element. Due to a lack of a CSS reset, the exact styling of
10 // the button depends on what type of element is used.
11 // There are two kinds of buttons, the default is a "Call to Action" with an obvious border
12 // and there is a quiet kind without a border.
16 @buttonBorderRadius: 3px;
17 @transitionDuration: .1s;
18 @transitionFunction: ease-in-out;
20 // Neutral button styling
23 // <button class="mw-ui-button">.mw-ui-button</button>
24 // <button class="mw-ui-button" disabled>.mw-ui-button</button>
29 display: inline-block;
32 .box-sizing(border-box);
35 // http://stackoverflow.com/a/5838575/365238
40 .button-colors(@colorWhite);
41 border-radius: @buttonBorderRadius;
43 // Ensure that buttons and inputs are nicely aligned when they have differing heights
44 vertical-align: middle;
49 text-shadow: 0 1px rgba(0, 0, 0, .1);
51 // Interaction styling
59 .transition(background @transitionDuration @transitionFunction, color @transitionDuration @transitionFunction, box-shadow @transitionDuration @transitionFunction;);
61 // Styling for specific button types
62 // -----------------------------------------
66 // Not all buttons are equal. You can emphasise certain actions over others
67 // using the mw-ui-big class.
70 // <button class="mw-ui-button mw-ui-big">.mw-ui-button</button>
71 // <button class="mw-ui-button mw-ui-progressive mw-ui-big">.mw-ui-progressive</button>
72 // <button class="mw-ui-button mw-ui-constructive mw-ui-big">.mw-ui-constructive</button>
73 // <button class="mw-ui-button mw-ui-destructive mw-ui-big">.mw-ui-destructive</button>
77 font-size: @baseFontSize * 1.3;
82 // Some buttons might need to be stacked.
85 // <button class="mw-ui-button mw-ui-block">.mw-ui-button</button>
86 // <button class="mw-ui-button mw-ui-progressive mw-ui-block">.mw-ui-progressive</button>
87 // <button class="mw-ui-button mw-ui-constructive mw-ui-block">.mw-ui-constructive</button>
88 // <button class="mw-ui-button mw-ui-destructive mw-ui-block">.mw-ui-destructive</button>
96 // Progressive buttons
98 // Use progressive buttons for actions which lead to a next step in the process.
99 // .mw-ui-primary is deprecated, kept for compatibility.
102 // <button class="mw-ui-button mw-ui-progressive">.mw-ui-progressive</button>
103 // <button class="mw-ui-button mw-ui-progressive" disabled>.mw-ui-progressive</button>
108 .button-colors(@colorProgressive);
111 .button-colors-quiet(@colorProgressive);
115 // Constructive buttons
117 // Use constructive buttons for actions which result in a final action in the process that results
118 // in a change of state.
119 // e.g. save changes button
122 // <button class="mw-ui-button mw-ui-constructive">.mw-ui-constructive</button>
123 // <button class="mw-ui-button mw-ui-constructive" disabled>.mw-ui-constructive</button>
126 &.mw-ui-constructive {
127 .button-colors(@colorConstructive);
130 .button-colors-quiet(@colorConstructive);
134 // Destructive buttons
136 // Use destructive buttons for actions which result in the destruction of data.
137 // e.g. deleting a page.
138 // This should not be used for cancel buttons.
141 // <button class="mw-ui-button mw-ui-destructive">.mw-ui-destructive</button>
142 // <button class="mw-ui-button mw-ui-destructive" disabled>.mw-ui-destructive</button>
145 &.mw-ui-destructive {
146 .button-colors(@colorDestructive);
149 .button-colors-quiet(@colorDestructive);
155 // Use quiet buttons when they are less important and alongisde other progressive/destructive/progressive buttons.
158 // <button class="mw-ui-button mw-ui-quiet">.mw-ui-button</button>
159 // <button class="mw-ui-button mw-ui-constructive mw-ui-quiet">.mw-ui-constructive</button>
160 // <button class="mw-ui-button mw-ui-constructive mw-ui-quiet" disabled>.mw-ui-constructive</button>
161 // <button class="mw-ui-button mw-ui-destructive mw-ui-quiet">.mw-ui-destructive</button>
162 // <button class="mw-ui-button mw-ui-destructive mw-ui-quiet" disabled>.mw-ui-destructive</button>
163 // <button class="mw-ui-button mw-ui-progressive mw-ui-quiet">.mw-ui-progressive</button>
164 // <button class="mw-ui-button mw-ui-progressive mw-ui-quiet" disabled>.mw-ui-progressive</button>
168 background: transparent;
171 .button-colors-quiet(@colorGrayDark);
180 background: transparent;
186 text-decoration: none;
188 // This overrides an underline declaration on a:hover and a:focus in
189 // commonElements.css, which the class alone isn't specific enough to do.
192 text-decoration: none;
198 // Group of buttons. Make sure you clear the floating after using a mw-ui-button-group.
201 // <div class="mw-ui-button-group">
202 // <div class="mw-ui-button">A</div>
203 // <div class="mw-ui-button">B</div>
204 // <div class="mw-ui-button">C</div>
205 // <div class="mw-ui-button">D</div>
206 // </div><div style="clear:both"></div>
209 .mw-ui-button-group > * {
214 border-top-left-radius: @buttonBorderRadius;
215 border-bottom-left-radius: @buttonBorderRadius;
218 &:not(:first-child) {
223 border-top-right-radius: @buttonBorderRadius;
224 border-bottom-right-radius: @buttonBorderRadius;