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;
48 text-shadow: 0 1px rgba(0, 0, 0, .1);
50 // Interaction styling
58 .transition(background @transitionDuration @transitionFunction, color @transitionDuration @transitionFunction, box-shadow @transitionDuration @transitionFunction;);
60 // Styling for specific button types
61 // -----------------------------------------
65 // Not all buttons are equal. You can emphasise certain actions over others
66 // using the mw-ui-big class.
69 // <button class="mw-ui-button mw-ui-big">.mw-ui-button</button>
70 // <button class="mw-ui-button mw-ui-progressive mw-ui-big">.mw-ui-progressive</button>
71 // <button class="mw-ui-button mw-ui-constructive mw-ui-big">.mw-ui-constructive</button>
72 // <button class="mw-ui-button mw-ui-destructive mw-ui-big">.mw-ui-destructive</button>
76 font-size: @baseFontSize * 1.3;
81 // Some buttons might need to be stacked.
84 // <button class="mw-ui-button mw-ui-block">.mw-ui-button</button>
85 // <button class="mw-ui-button mw-ui-progressive mw-ui-block">.mw-ui-progressive</button>
86 // <button class="mw-ui-button mw-ui-constructive mw-ui-block">.mw-ui-constructive</button>
87 // <button class="mw-ui-button mw-ui-destructive mw-ui-block">.mw-ui-destructive</button>
95 // Progressive buttons
97 // Use progressive buttons for actions which lead to a next step in the process.
98 // .mw-ui-primary is deprecated, kept for compatibility.
101 // <button class="mw-ui-button mw-ui-progressive">.mw-ui-progressive</button>
102 // <button class="mw-ui-button mw-ui-progressive" disabled>.mw-ui-progressive</button>
107 .button-colors(@colorProgressive);
110 .button-colors-quiet(@colorProgressive);
114 // Constructive buttons
116 // Use constructive buttons for actions which result in a final action in the process that results
117 // in a change of state.
118 // e.g. save changes button
121 // <button class="mw-ui-button mw-ui-constructive">.mw-ui-constructive</button>
122 // <button class="mw-ui-button mw-ui-constructive" disabled>.mw-ui-constructive</button>
125 &.mw-ui-constructive {
126 .button-colors(@colorConstructive);
129 .button-colors-quiet(@colorConstructive);
133 // Destructive buttons
135 // Use destructive buttons for actions which result in the destruction of data.
136 // e.g. deleting a page.
137 // This should not be used for cancel buttons.
140 // <button class="mw-ui-button mw-ui-destructive">.mw-ui-destructive</button>
141 // <button class="mw-ui-button mw-ui-destructive" disabled>.mw-ui-destructive</button>
144 &.mw-ui-destructive {
145 .button-colors(@colorDestructive);
148 .button-colors-quiet(@colorDestructive);
154 // Use quiet buttons when they are less important and alongisde other progressive/destructive/progressive buttons.
157 // <button class="mw-ui-button mw-ui-quiet">.mw-ui-button</button>
158 // <button class="mw-ui-button mw-ui-constructive mw-ui-quiet">.mw-ui-constructive</button>
159 // <button class="mw-ui-button mw-ui-constructive mw-ui-quiet" disabled>.mw-ui-constructive</button>
160 // <button class="mw-ui-button mw-ui-destructive mw-ui-quiet">.mw-ui-destructive</button>
161 // <button class="mw-ui-button mw-ui-destructive mw-ui-quiet" disabled>.mw-ui-destructive</button>
162 // <button class="mw-ui-button mw-ui-progressive mw-ui-quiet">.mw-ui-progressive</button>
163 // <button class="mw-ui-button mw-ui-progressive mw-ui-quiet" disabled>.mw-ui-progressive</button>
167 background: transparent;
170 .button-colors-quiet(@colorGrayDark);
179 background: transparent;
185 text-decoration: none;
187 // This overrides an underline declaration on a:hover and a:focus in
188 // commonElements.css, which the class alone isn't specific enough to do.
191 text-decoration: none;
197 // Group of buttons. Make sure you clear the floating after using a mw-ui-button-group.
200 // <div class="mw-ui-button-group">
201 // <div class="mw-ui-button">A</div>
202 // <div class="mw-ui-button">B</div>
203 // <div class="mw-ui-button">C</div>
204 // <div class="mw-ui-button">D</div>
205 // </div><div style="clear:both"></div>
208 .mw-ui-button-group > * {
213 border-top-left-radius: @buttonBorderRadius;
214 border-bottom-left-radius: @buttonBorderRadius;
218 border-top-right-radius: @buttonBorderRadius;
219 border-bottom-right-radius: @buttonBorderRadius;