Merge "Introduce InterwikiLookupAdapter on top of SiteLookup"
[lhc/web/wiklou.git] / resources / src / mediawiki.ui / components / buttons.less
index 4ffaeee..85795f4 100644 (file)
@@ -14,7 +14,7 @@
 
 // Neutral button styling
 //
-// 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.
+// These are the main actions on the page/workflow. The page should have only one of progressive and destructive buttons, the rest being quiet.
 //
 // Markup:
 // <div>
        font-size: 1em;
        // Container layout
        display: inline-block;
+       min-width: 4em;
+       max-width: 28.75em; // equivalent to 460px, @see T95367
        padding: .5em 1em;
        margin: 0;
+       border-radius: @borderRadius;
        .box-sizing( border-box );
 
        // Disable weird iOS styling
        *display: inline;
        zoom: 1;
 
-       // Container styling
-       .button-colors( #fff, #ccc, #777 );
-       border-radius: @borderRadius;
-       min-width: 4em;
-
        // Ensure that buttons and inputs are nicely aligned when they have differing heights
        vertical-align: middle;
 
        // Content styling
+       .button-colors( @colorGray15, #fff, #d9d9d9 );
        text-align: center;
        font-weight: bold;
 
        // Interaction styling
        cursor: pointer;
 
+       &:focus {
+               outline-width: 0;
+
+               // Remove the inner border and padding in Firefox.
+               &::-moz-focus-inner {
+                       border-color: transparent;
+                       padding: 0;
+               }
+       }
+
+       // `:not()` is used exclusively for `transition`s as both are not supported by IE < 9
+       &:not( :disabled ) {
+               .transition( ~'background-color 100ms, color 100ms, border-color 100ms, box-shadow 100ms' );
+       }
+
        &:disabled {
                text-shadow: none;
                cursor: default;
@@ -79,9 +93,6 @@
        //   <button class="mw-ui-button mw-ui-progressive mw-ui-big">.mw-ui-progressive</button>
        // </div>
        // <div>
-       //   <button class="mw-ui-button mw-ui-constructive mw-ui-big">.mw-ui-constructive</button>
-       // </div>
-       // <div>
        //   <button class="mw-ui-button mw-ui-destructive mw-ui-big">.mw-ui-destructive</button>
        // </div>
        //
        //   <button class="mw-ui-button mw-ui-progressive mw-ui-block">.mw-ui-progressive</button>
        // </div>
        // <div>
-       //   <button class="mw-ui-button mw-ui-constructive mw-ui-block">.mw-ui-constructive</button>
-       // </div>
-       // <div>
        //   <button class="mw-ui-button mw-ui-destructive mw-ui-block">.mw-ui-destructive</button>
        // </div>
        //
        &.mw-ui-block {
                display: block;
                width: 100%;
+               margin-left: auto;
+               margin-right: auto;
        }
 
        // Progressive buttons
        //
        // Use progressive buttons for actions which lead to a next step in the process.
-       // .mw-ui-primary is deprecated, kept for compatibility.
+       // .mw-ui-constructive is deprecated; consolidated with `progressive`, see T110555
        //
        // Markup:
        // <div>
        //
        // Styleguide 2.1.1.
        &.mw-ui-progressive,
-       &.mw-ui-primary {
-               .button-colors( @colorProgressive, @colorProgressiveHighlight, @colorProgressiveActive );
-
-               &.mw-ui-quiet {
-                       .button-colors-quiet( @colorProgressive, @colorProgressiveHighlight, @colorProgressiveActive );
-               }
-       }
-
-       // Constructive buttons
-       //
-       // Use constructive buttons for actions which result in a final action in the process that results
-       // in a change of state.
-       // e.g. save changes button
-       //
-       // Markup:
-       // <div>
-       //   <button class="mw-ui-button mw-ui-constructive">.mw-ui-constructive</button>
-       // </div>
-       // <div>
-       //   <button class="mw-ui-button mw-ui-constructive" disabled>.mw-ui-constructive</button>
-       // </div>
-       //
-       // Styleguide 2.1.2.
        &.mw-ui-constructive {
-               .button-colors( @colorConstructive, @colorConstructiveHighlight, @colorConstructiveActive );
+               .button-colors-primary( @colorProgressive, @colorProgressiveHighlight, @colorProgressiveActive );
 
                &.mw-ui-quiet {
-                       .button-colors-quiet( @colorConstructive, @colorConstructiveHighlight, @colorConstructiveActive );
+                       .button-colors-quiet( @colorProgressive, @colorProgressiveHighlight, @colorProgressiveActive );
                }
        }
 
        //   <button class="mw-ui-button mw-ui-destructive" disabled>.mw-ui-destructive</button>
        // </div>
        //
-       // Styleguide 2.1.3.
+       // Styleguide 2.1.2.
        &.mw-ui-destructive {
-               .button-colors( @colorDestructive, @colorDestructiveHighlight, @colorDestructiveActive );
+               .button-colors-primary( @colorDestructive, @colorDestructiveHighlight, @colorDestructiveActive );
 
                &.mw-ui-quiet {
                        .button-colors-quiet( @colorDestructive, @colorDestructiveHighlight, @colorDestructiveActive );
 
        // Quiet buttons
        //
-       // 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.
+       // Use quiet buttons when they are less important and alongside other progressive or destructive buttons. It should be used for an action that exits the user from the current view/workflow.
        // Its use is  not recommended on mobile/tablet due to lack of hover state.
        //
        // Markup:
        //   <button class="mw-ui-button mw-ui-quiet">.mw-ui-button</button>
        // </div>
        // <div>
-       //   <button class="mw-ui-button mw-ui-constructive mw-ui-quiet">.mw-ui-constructive</button>
-       // </div>
-       // <div>
-       //   <button class="mw-ui-button mw-ui-constructive mw-ui-quiet" disabled>.mw-ui-constructive</button>
-       // </div>
-       // <div>
        //   <button class="mw-ui-button mw-ui-destructive mw-ui-quiet">.mw-ui-destructive</button>
        // </div>
        // <div>
        //   <button class="mw-ui-button mw-ui-progressive mw-ui-quiet" disabled>.mw-ui-progressive</button>
        // </div>
        //
-       // Styleguide 2.1.4.
+       // Styleguide 2.1.3.
        &.mw-ui-quiet {
                background: transparent;
                border: 0;
@@ -252,29 +233,35 @@ a.mw-ui-button {
 //
 // Markup:
 // <div class="mw-ui-button-group">
-//   <div class="mw-ui-button">A</div>
+//   <div class="mw-ui-button is-on">A</div>
 //   <div class="mw-ui-button">B</div>
 //   <div class="mw-ui-button">C</div>
 //   <div class="mw-ui-button">D</div>
 // </div><div style="clear:both"></div>
 //
 // Styleguide 2.2.
-.mw-ui-button-group > * {
-       min-width: 48px;
-       border-radius: 0;
-       float: left;
+.mw-ui-button-group {
+       & > * {
+               min-width: 48px;
+               border-radius: 0;
+               float: left;
 
-       &:first-child {
-               border-top-left-radius: @borderRadius;
-               border-bottom-left-radius: @borderRadius;
-       }
+               &:first-child {
+                       border-top-left-radius: @borderRadius;
+                       border-bottom-left-radius: @borderRadius;
+               }
+
+               &:not( :first-child ) {
+                       border-left: 0;
+               }
 
-       &:not( :first-child ) {
-               border-left: 0;
+               &:last-child {
+                       border-top-right-radius: @borderRadius;
+                       border-bottom-right-radius: @borderRadius;
+               }
        }
 
-       &:last-child{
-               border-top-right-radius: @borderRadius;
-               border-bottom-right-radius: @borderRadius;
+       & .is-on .button {
+               cursor: default;
        }
 }