Merge "Add hook to allow extensions to modify query used by Special:ShortPages"
[lhc/web/wiklou.git] / resources / src / mediawiki.ui / components / anchors.less
1 @import "mediawiki.mixins";
2 @import "mediawiki.ui/variables";
3 @import "mediawiki.ui/mixins";
4
5 // Helpers
6 .mixin-mw-ui-anchor-styles( @mainColor ) {
7 color: @mainColor;
8
9 // Hover state
10 &:hover {
11 color: lighten( @mainColor, @colorLightenPercentage );
12 }
13 // Focus and active states
14 &:focus,
15 &:active {
16 color: darken( @mainColor, @colorDarkenPercentage );
17 outline: none; // outline fix
18 }
19
20 // Quiet mode is gray at first
21 &.mw-ui-quiet {
22 .mixin-mw-ui-anchor-styles-quiet( @mainColor );
23 }
24 }
25
26 /*
27 Anchors
28
29 The anchor base type can be applied to A elements when a basic context styling needs to be given to a link, without
30 having to assign it as a button type. mw-ui-anchor only changes the text color, and should not be used in combination
31 with other base classes, such as mw-ui-button.
32
33 Markup:
34 <a href="#" class="mw-ui-anchor mw-ui-progressive">Progressive</a>
35 <a href="#" class="mw-ui-anchor mw-ui-constructive">Constructive</a>
36 <a href="#" class="mw-ui-anchor mw-ui-destructive">Destructive</a>
37
38 .mw-ui-quiet - Quiet until interaction.
39
40 Styleguide 6.2.
41 */
42
43 // Setup compound anchor selectors (such as .mw-ui-anchor.mw-ui-progressive)
44 .mw-ui-anchor {
45 &.mw-ui-progressive {
46 .mixin-mw-ui-anchor-styles( @colorProgressive );
47 }
48
49 &.mw-ui-constructive {
50 .mixin-mw-ui-anchor-styles( @colorConstructive );
51 }
52
53 &.mw-ui-destructive {
54 .mixin-mw-ui-anchor-styles( @colorDestructive );
55 }
56 }
57
58 /*
59 Quiet anchors
60
61 Use quiet anchors when they are less important and alongside other progressive/destructive/progressive
62 anchors. Use of quiet anchors is not recommended on mobile/tablet due to lack of hover state.
63
64 Markup:
65 <a href="#" class="mw-ui-anchor mw-ui-progressive mw-ui-quiet">Progressive</a>
66 <a href="#" class="mw-ui-anchor mw-ui-constructive mw-ui-quiet">Constructive</a>
67 <a href="#" class="mw-ui-anchor mw-ui-destructive mw-ui-quiet">Destructive</a>
68
69 Styleguide 6.2.1.
70 */
71 .mixin-mw-ui-anchor-styles-quiet( @mainColor ) {
72 color: @colorTextLight;
73 text-decoration: none;
74
75 &:hover {
76 color: @mainColor;
77 }
78 &:focus,
79 &:active {
80 color: darken( @mainColor, @colorDarkenPercentage );
81 }
82 }