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>
24 // <button class="mw-ui-button mw-ui-quiet">.mw-ui-button</button>
25 // <button class="mw-ui-button mw-ui-quiet" disabled>.mw-ui-button</button>
30 display: inline-block;
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;
50 text-shadow: 0 1px rgba(0, 0, 0, .1);
52 // Interaction styling
60 .transition(background @transitionDuration @transitionFunction, color @transitionDuration @transitionFunction, box-shadow @transitionDuration @transitionFunction;);
62 // Styling for specific button types
63 // -----------------------------------------
65 font-size: @baseFontSize * 1.3;
73 // Progressive buttons
75 // Use progressive buttons for actions which lead to a next step in the process.
76 // .mw-ui-primary is deprecated, kept for compatibility.
79 // <button class="mw-ui-button mw-ui-progressive">.mw-ui-progressive</button>
80 // <button class="mw-ui-button mw-ui-progressive" disabled>.mw-ui-progressive</button>
81 // <button class="mw-ui-button mw-ui-progressive mw-ui-quiet">.mw-ui-progressive</button>
82 // <button class="mw-ui-button mw-ui-progressive mw-ui-quiet" disabled>.mw-ui-progressive</button>
87 .button-colors(@colorProgressive);
90 .button-colors-quiet(@colorProgressive);
94 // Constructive buttons
96 // Use constructive buttons for actions which result in a final action in the process that results
97 // in a change of state.
98 // e.g. save changes button
101 // <button class="mw-ui-button mw-ui-constructive">.mw-ui-constructive</button>
102 // <button class="mw-ui-button mw-ui-constructive" disabled>.mw-ui-constructive</button>
103 // <button class="mw-ui-button mw-ui-constructive mw-ui-quiet">.mw-ui-constructive</button>
104 // <button class="mw-ui-button mw-ui-constructive mw-ui-quiet" disabled>.mw-ui-constructive</button>
107 &.mw-ui-constructive {
108 .button-colors(@colorConstructive);
111 .button-colors-quiet(@colorConstructive);
115 // Destructive buttons
117 // Use destructive buttons for actions which result in the destruction of data.
118 // e.g. deleting a page.
119 // This should not be used for cancel buttons.
122 // <button class="mw-ui-button mw-ui-destructive">.mw-ui-destructive</button>
123 // <button class="mw-ui-button mw-ui-destructive" disabled>.mw-ui-destructive</button>
124 // <button class="mw-ui-button mw-ui-destructive mw-ui-quiet">.mw-ui-destructive</button>
125 // <button class="mw-ui-button mw-ui-destructive mw-ui-quiet" disabled>.mw-ui-destructive</button>
128 &.mw-ui-destructive {
129 .button-colors(@colorDestructive);
132 .button-colors-quiet(@colorDestructive);
137 background: transparent;
140 .button-colors-quiet(@colorGrayDark);
149 background: transparent;
155 text-decoration: none;
157 // This overrides an underline declaration on a:hover and a:focus in
158 // commonElements.css, which the class alone isn't specific enough to do.
161 text-decoration: none;
167 // Group of buttons. Make sure you clear the floating after using a mw-ui-button-group.
170 // <div class="mw-ui-button-group">
171 // <div class="mw-ui-button">A</div>
172 // <div class="mw-ui-button">B</div>
173 // <div class="mw-ui-button">C</div>
174 // <div class="mw-ui-button">D</div>
175 // </div><div style="clear:both"></div>
178 .mw-ui-button-group > * {
183 border-top-left-radius: @buttonBorderRadius;
184 border-bottom-left-radius: @buttonBorderRadius;
188 border-top-right-radius: @buttonBorderRadius;
189 border-bottom-right-radius: @buttonBorderRadius;