Merge "Use HTML::hidden to create input fields"
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / styles / mw.rcfilters.mixins.less
1 @import 'mediawiki.mixins';
2 @import 'mw.rcfilters.variables';
3
4 .animation-delay( ... ) {
5 -webkit-animation-delay: @arguments; // Chrome 4-42, Safari 4-8, Opera 15-29, Android 2.1-4.4.4
6 -moz-animation-delay: @arguments; // Firefox 5-15
7 animation-delay: @arguments; // Chrome 43+, Firefox 16+, IE 10+, Edge 12+, Safari 9+, Opera 12.10 & 30+, iOS 9+, Android 47+
8 }
9
10 // This is a general mixin for a color circle
11 .mw-rcfilters-mixin-circle( @color: white, @diameter: 2em, @padding: 0.5em, @border: false ) {
12 border-radius: 50%;
13 min-width: @diameter;
14 width: @diameter;
15 min-height: @diameter;
16 height: @diameter;
17 margin: @padding;
18 .box-sizing( border-box );
19
20 background-color: @color;
21
22 & when (@border = true) {
23 border: 1px solid #565656;
24 }
25 }
26
27 // This is the circle that appears next to the results
28 // Its visibility is directly dependent on whether there is
29 // a color class on its parent element
30 .result-circle( @colorName: 'none' ) {
31 &-@{colorName} {
32 .mw-rcfilters-mixin-circle( ~'@{highlight-@{colorName}}', @result-circle-diameter, 0 );
33 display: none;
34
35 .mw-rcfilters-highlight-color-@{colorName} & {
36 display: inline-block;
37 }
38 }
39 }
40
41 // This mixin produces color mixes for two, three and four colors
42 .highlight-color-mix( @color1, @color2, @color3: false, @color4: false ) {
43 @highlight-color-class-var: ~'.mw-rcfilters-highlight-color-@{color1}.mw-rcfilters-highlight-color-@{color2}';
44
45 // The nature of these variables and them being inside
46 // a 'tint' and 'average' LESS functions is such where
47 // the parsing is failing if it is done inside those functions.
48 // Instead, we first construct their LESS variable names,
49 // and then we call them inside those functions by calling @@var
50 @c1var: ~'highlight-@{color1}';
51 @c2var: ~'highlight-@{color2}';
52
53 // Two colors
54 @{highlight-color-class-var} when ( @color3 = false ) and ( @color4 = false ) and not ( @color1 = false ), ( @color2 = false ) {
55 background-color: tint( average( @@c1var, @@c2var ), 50% );
56 }
57 // Three colors
58 @{highlight-color-class-var}.mw-rcfilters-highlight-color-@{color3} when ( @color4 = false ) and not ( @color3 = false ) {
59 @c3var: ~'highlight-@{color3}';
60 background-color: tint( mix( @@c1var, average( @@c2var, @@c3var ), 33% ), 30% );
61 }
62
63 // Four colors
64 @{highlight-color-class-var}.mw-rcfilters-highlight-color-@{color3}.mw-rcfilters-highlight-color-@{color4} when not ( @color4 = false ) {
65 @c3var: ~'highlight-@{color3}';
66 @c4var: ~'highlight-@{color4}';
67 background-color: tint( mix( @@c1var, mix( @@c2var, average( @@c3var, @@c4var ), 25% ), 25% ), 25% );
68 }
69 }