1 @import "mediawiki.mixins";
2 @import "../../settings/typography";
3 @import "../../mixins/effects";
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>
28 display: inline-block;
33 // http://stackoverflow.com/a/5838575/365238
38 .button-colors(@colorWhite);
39 border-radius: @buttonBorderRadius;
41 // Ensure that buttons and inputs are nicely aligned when they have differing heights
42 vertical-align: middle;
47 text-shadow: 0 1px rgba(0, 0, 0, .1);
49 // Interaction styling
57 .transition(background @transitionDuration @transitionFunction, color @transitionDuration @transitionFunction, box-shadow @transitionDuration @transitionFunction;);
59 // Styling for specific button types
60 // -----------------------------------------
64 // Not all buttons are equal. You can emphasise certain actions over others
65 // using the mw-ui-big class.
68 // <button class="mw-ui-button mw-ui-big">.mw-ui-button</button>
69 // <button class="mw-ui-button mw-ui-progressive mw-ui-big">.mw-ui-progressive</button>
70 // <button class="mw-ui-button mw-ui-constructive mw-ui-big">.mw-ui-constructive</button>
71 // <button class="mw-ui-button mw-ui-destructive mw-ui-big">.mw-ui-destructive</button>
75 font-size: @baseFontSize * 1.3;
80 // Some buttons might need to be stacked.
83 // <button class="mw-ui-button mw-ui-block">.mw-ui-button</button>
84 // <button class="mw-ui-button mw-ui-progressive mw-ui-block">.mw-ui-progressive</button>
85 // <button class="mw-ui-button mw-ui-constructive mw-ui-block">.mw-ui-constructive</button>
86 // <button class="mw-ui-button mw-ui-destructive mw-ui-block">.mw-ui-destructive</button>
94 // Progressive buttons
96 // Use progressive buttons for actions which lead to a next step in the process.
97 // .mw-ui-primary is deprecated, kept for compatibility.
100 // <button class="mw-ui-button mw-ui-progressive">.mw-ui-progressive</button>
101 // <button class="mw-ui-button mw-ui-progressive" disabled>.mw-ui-progressive</button>
106 .button-colors(@colorProgressive);
109 .button-colors-quiet(@colorProgressive);
113 // Constructive buttons
115 // Use constructive buttons for actions which result in a final action in the process that results
116 // in a change of state.
117 // e.g. save changes button
120 // <button class="mw-ui-button mw-ui-constructive">.mw-ui-constructive</button>
121 // <button class="mw-ui-button mw-ui-constructive" disabled>.mw-ui-constructive</button>
124 &.mw-ui-constructive {
125 .button-colors(@colorConstructive);
128 .button-colors-quiet(@colorConstructive);
132 // Destructive buttons
134 // Use destructive buttons for actions which result in the destruction of data.
135 // e.g. deleting a page.
136 // This should not be used for cancel buttons.
139 // <button class="mw-ui-button mw-ui-destructive">.mw-ui-destructive</button>
140 // <button class="mw-ui-button mw-ui-destructive" disabled>.mw-ui-destructive</button>
143 &.mw-ui-destructive {
144 .button-colors(@colorDestructive);
147 .button-colors-quiet(@colorDestructive);
153 // Use quiet buttons when they are less important and alongisde other progressive/destructive/progressive buttons.
156 // <button class="mw-ui-button mw-ui-quiet">.mw-ui-button</button>
157 // <button class="mw-ui-button mw-ui-constructive mw-ui-quiet">.mw-ui-constructive</button>
158 // <button class="mw-ui-button mw-ui-constructive mw-ui-quiet" disabled>.mw-ui-constructive</button>
159 // <button class="mw-ui-button mw-ui-destructive mw-ui-quiet">.mw-ui-destructive</button>
160 // <button class="mw-ui-button mw-ui-destructive mw-ui-quiet" disabled>.mw-ui-destructive</button>
161 // <button class="mw-ui-button mw-ui-progressive mw-ui-quiet">.mw-ui-progressive</button>
162 // <button class="mw-ui-button mw-ui-progressive mw-ui-quiet" disabled>.mw-ui-progressive</button>
166 background: transparent;
169 .button-colors-quiet(@colorGrayDark);
178 background: transparent;
184 text-decoration: none;
186 // This overrides an underline declaration on a:hover and a:focus in
187 // commonElements.css, which the class alone isn't specific enough to do.
190 text-decoration: none;
196 // Group of buttons. Make sure you clear the floating after using a mw-ui-button-group.
199 // <div class="mw-ui-button-group">
200 // <div class="mw-ui-button">A</div>
201 // <div class="mw-ui-button">B</div>
202 // <div class="mw-ui-button">C</div>
203 // <div class="mw-ui-button">D</div>
204 // </div><div style="clear:both"></div>
207 .mw-ui-button-group > * {
212 border-top-left-radius: @buttonBorderRadius;
213 border-bottom-left-radius: @buttonBorderRadius;
216 &:not(:first-child) {
221 border-top-right-radius: @buttonBorderRadius;
222 border-bottom-right-radius: @buttonBorderRadius;