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 // Neutral button styling
17 // These are the main actions on the page/workflow. The page should have only one of progressive, constructive and desctructive buttons, the rest being quiet.
21 // <button class="mw-ui-button">.mw-ui-button</button>
24 // <button class="mw-ui-button" disabled>.mw-ui-button</button>
29 // Inherit the font rather than apply user agent stylesheet (bug 70072)
33 display: inline-block;
35 max-width: 28.75em; // equivalent to 460px, @see T95367
38 border-radius: @borderRadius;
39 .box-sizing( border-box );
41 // Disable weird iOS styling
42 -webkit-appearance: none;
45 // https://stackoverflow.com/a/5838575/365238
49 // Ensure that buttons and inputs are nicely aligned when they have differing heights
50 vertical-align: middle;
53 .button-colors( @colorGray15, #fff, #d9d9d9 );
57 // Interaction styling
63 // Remove the inner border and padding in Firefox.
65 border-color: transparent;
70 // `:not()` is used exclusively for `transition`s as both are not supported by IE < 9
72 .transition( ~'background-color 100ms, color 100ms, border-color 100ms, box-shadow 100ms' );
80 // Styling for specific button types
81 // -----------------------------------------
85 // Not all buttons are equal. You can emphasise certain actions over others
86 // using the mw-ui-big class.
90 // <button class="mw-ui-button mw-ui-big">.mw-ui-button</button>
93 // <button class="mw-ui-button mw-ui-progressive mw-ui-big">.mw-ui-progressive</button>
96 // <button class="mw-ui-button mw-ui-constructive mw-ui-big">.mw-ui-constructive</button>
99 // <button class="mw-ui-button mw-ui-destructive mw-ui-big">.mw-ui-destructive</button>
109 // Some buttons might need to be stacked.
113 // <button class="mw-ui-button mw-ui-block">.mw-ui-button</button>
116 // <button class="mw-ui-button mw-ui-progressive mw-ui-block">.mw-ui-progressive</button>
119 // <button class="mw-ui-button mw-ui-constructive mw-ui-block">.mw-ui-constructive</button>
122 // <button class="mw-ui-button mw-ui-destructive mw-ui-block">.mw-ui-destructive</button>
133 // Progressive buttons
135 // Use progressive buttons for actions which lead to a next step in the process.
136 // .mw-ui-constructive is deprecated; consolidated with `progressive`, see T110555
137 // .mw-ui-primary is deprecated, kept for compatibility.
141 // <button class="mw-ui-button mw-ui-progressive">.mw-ui-progressive</button>
144 // <button class="mw-ui-button mw-ui-progressive" disabled>.mw-ui-progressive</button>
149 &.mw-ui-constructive,
151 .button-colors-primary( @colorProgressive, @colorProgressiveHighlight, @colorProgressiveActive );
154 .button-colors-quiet( @colorProgressive, @colorProgressiveHighlight, @colorProgressiveActive );
158 // Destructive buttons
160 // Use destructive buttons for actions that remove or limit, such as deleting a page or blocking a user.
161 // This should not be used for cancel buttons.
165 // <button class="mw-ui-button mw-ui-destructive">.mw-ui-destructive</button>
168 // <button class="mw-ui-button mw-ui-destructive" disabled>.mw-ui-destructive</button>
172 &.mw-ui-destructive {
173 .button-colors-primary( @colorDestructive, @colorDestructiveHighlight, @colorDestructiveActive );
176 .button-colors-quiet( @colorDestructive, @colorDestructiveHighlight, @colorDestructiveActive );
182 // Use quiet buttons when they are less important and alongside other constructive, progressive or destructive buttons. It should be used for an action that exits the user from the current view/workflow.
183 // Its use is not recommended on mobile/tablet due to lack of hover state.
187 // <button class="mw-ui-button mw-ui-quiet">.mw-ui-button</button>
190 // <button class="mw-ui-button mw-ui-constructive mw-ui-quiet">.mw-ui-constructive</button>
193 // <button class="mw-ui-button mw-ui-constructive mw-ui-quiet" disabled>.mw-ui-constructive</button>
196 // <button class="mw-ui-button mw-ui-destructive mw-ui-quiet">.mw-ui-destructive</button>
199 // <button class="mw-ui-button mw-ui-destructive mw-ui-quiet" disabled>.mw-ui-destructive</button>
202 // <button class="mw-ui-button mw-ui-progressive mw-ui-quiet">.mw-ui-progressive</button>
205 // <button class="mw-ui-button mw-ui-progressive mw-ui-quiet" disabled>.mw-ui-progressive</button>
210 background: transparent;
213 .button-colors-quiet( @colorButtonText, @colorButtonTextHighlight, @colorButtonTextActive );
222 background: transparent;
228 text-decoration: none;
230 // This overrides an underline declaration on a:hover and a:focus in
231 // commonElements.css, which the class alone isn't specific enough to do.
234 text-decoration: none;
237 // a-tags behave different to inputs if the line-height attribute is inherited
238 // from another element (e.g. mw-body-content). They appear bigger as input
239 // tags. See Bug T116427. To fix that, apply the correct line-height (used
240 // for inputs) to a-tags, too.
246 // Group of buttons. Make sure you clear the floating after using a mw-ui-button-group.
249 // <div class="mw-ui-button-group">
250 // <div class="mw-ui-button is-on">A</div>
251 // <div class="mw-ui-button">B</div>
252 // <div class="mw-ui-button">C</div>
253 // <div class="mw-ui-button">D</div>
254 // </div><div style="clear:both"></div>
257 .mw-ui-button-group {
264 border-top-left-radius: @borderRadius;
265 border-bottom-left-radius: @borderRadius;
268 &:not( :first-child ) {
273 border-top-right-radius: @borderRadius;
274 border-bottom-right-radius: @borderRadius;