build: Enable declaration-block-no-duplicate-properties stylelint rule
[lhc/web/wiklou.git] / resources / src / mediawiki.ui / components / buttons.less
index 5931efb..0e97a36 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>
 
        // IE 6 & 7 hack
        // https://stackoverflow.com/a/5838575/365238
-       *display: inline;
+       *display: inline; /* stylelint-disable-line declaration-block-no-duplicate-properties */
        zoom: 1;
 
        // Ensure that buttons and inputs are nicely aligned when they have differing heights
        vertical-align: middle;
 
        // Content styling
-       .button-colors( #fff, @colorGray12, @colorGray7 );
+       .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;
@@ -78,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>
        //
        // 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 (deprecated, consolidated with `progressive` – see T110555)
-       //
-       // 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( @colorProgressive, @colorProgressiveHighlight, @colorProgressiveActive );
+               .button-colors-primary( @colorProgressive, @colorProgressiveHighlight, @colorProgressiveActive );
 
                &.mw-ui-quiet {
                        .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;