Updating style documentation for quiet anchors and quiet buttons
authorkaldari <rkaldari@wikimedia.org>
Tue, 7 Oct 2014 00:30:15 +0000 (17:30 -0700)
committerBartosz Dziewoński <matma.rex@gmail.com>
Tue, 7 Oct 2014 06:49:08 +0000 (08:49 +0200)
See discussion on design-l for more context:
https://lists.wikimedia.org/pipermail/design/2014-October/002161.html

Change-Id: I1d958724d4222c95ad5ed52778d26228b09bd121

resources/src/mediawiki.ui/components/anchors.less
resources/src/mediawiki.ui/components/buttons.less

index 1a58170..f0fb7b9 100644 (file)
        }
 }
 
-.mixin-mw-ui-anchor-styles-quiet( @mainColor ) {
-       color: @colorTextLight;
-       text-decoration: none;
-
-       &:hover {
-               color: @mainColor;
-       }
-       &:focus, &:active {
-               color: darken( @mainColor, @colorDarkenPercentage );
-       }
-}
-
 /*
 Anchors
 
@@ -42,16 +30,16 @@ having to assign it as a button type. mw-ui-anchor only changes the text color,
 with other base classes, such as mw-ui-button.
 
 Markup:
-<a href=# class="mw-ui-anchor mw-ui-progressive {$modifiers}">Progressive</a>
-<a href=# class="mw-ui-anchor mw-ui-constructive {$modifiers}">Constructive</a>
-<a href=# class="mw-ui-anchor mw-ui-destructive {$modifiers}">Destructive</a>
+<a href="#" class="mw-ui-anchor mw-ui-progressive">Progressive</a>
+<a href="#" class="mw-ui-anchor mw-ui-constructive">Constructive</a>
+<a href="#" class="mw-ui-anchor mw-ui-destructive">Destructive</a>
 
 .mw-ui-quiet - Quiet until interaction.
 
 Styleguide 6.2.
 */
 
-// Setup compound anchor selectors (such as .mw-ui-anchor.my-ui-progressive)
+// Setup compound anchor selectors (such as .mw-ui-anchor.mw-ui-progressive)
 .mw-ui-anchor {
        &.mw-ui-progressive {
                .mixin-mw-ui-anchor-styles( @colorProgressive );
@@ -65,3 +53,28 @@ Styleguide 6.2.
                .mixin-mw-ui-anchor-styles( @colorDestructive );
        }
 }
+
+/*
+Quiet anchors
+
+Use quiet anchors when they are less important and alongside other progressive/destructive/progressive
+anchors. Use of quiet anchors is not recommended on mobile/tablet due to lack of hover state.
+
+Markup:
+<a href="#" class="mw-ui-anchor mw-ui-progressive mw-ui-quiet">Progressive</a>
+<a href="#" class="mw-ui-anchor mw-ui-constructive mw-ui-quiet">Constructive</a>
+<a href="#" class="mw-ui-anchor mw-ui-destructive mw-ui-quiet">Destructive</a>
+
+Styleguide 6.2.1.
+*/
+.mixin-mw-ui-anchor-styles-quiet( @mainColor ) {
+       color: @colorTextLight;
+       text-decoration: none;
+
+       &:hover {
+               color: @mainColor;
+       }
+       &:focus, &:active {
+               color: darken( @mainColor, @colorDarkenPercentage );
+       }
+}
index 01c481d..6490996 100644 (file)
        // Quiet buttons
        //
        // Use quiet buttons when they are less important and alongisde other progressive/destructive/progressive buttons.
+       // Use of quiet buttons is not recommended on mobile/tablet due to lack of hover state.
        //
        // Markup:
        // <div>