summaryrefslogtreecommitdiff
path: root/www/wiki/skins/chameleon/resources/styles/mixins.less
blob: e7bb7f06671e5a342855d492fec33dd7b770e427 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/**
 * Mixins used for the Chameleon skin styles
 *
 * This file is part of the MediaWiki skin Chameleon.
 *
 * @copyright 2013 - 2014, Stephan Gambke
 * @license   GNU General Public License, version 3 (or any later version)
 *
 * The Chameleon skin is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your option) any
 * later version.
 *
 * The Chameleon skin is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * @author Stephan Gambke
 * @since 1.0
 * @ingroup Skins
 */

/**
 * Colors for links
 *
 * :hover MUST come after :link and :visited
 * :active MUST come after :hover
 */
.link( @color ) {
	&:link {
		color: @color;
	}
	&:visited {
		color: darken(@color, 20%);
	}
	&:focus {
		color: darken(@color, 15%);
	}
	&:hover {
		color: darken(@color, 15%);
	}
	&:active {
		color: difference(@color, #ffffff);
	}
	&:visited:focus {
		color: darken(@color, 30%);
	}
	&:visited:hover {
		color: darken(@color, 30%);
	}
}

// Produces an SVG bullet with the diameter equal to the minimum from @width
// and @height; the bullet is centered horizontally and placed at 65% from the
// top vertically (or as far down as possible given the diameter)
.bullet( @color: @list-bullet-color, @width: @list-bullet-size, @height: @font-size-base ) {
	list-style: outside disc e(%('url("data:image/svg+xml;charset=UTF-8,%s")', escape( %('<svg width="%s" height="%s" version="1.1" xmlns="http://www.w3.org/2000/svg"><circle cx="%s" cy="%s" r="%s" fill="@{color}"/></svg>',	unit(@width), unit(@height), unit(@width/2), unit(min(@height - min(@width, @height)/2, 0.65*@height)), unit( min(@width, @height) )/2))));
	// IE hack: IE < 9 does not properly work with SVGs. Serve them some fallback PNG.
	list-style-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAJCAYAAAARml2dAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABUSURBVAiZdY4xDsAgFELB2J0DdnbwQI5OHvDfgC62SY0yvhAetI1dWEq5JN0kKwDYbhEx8oT9a5JdEtLb/M2QNW0FAJLttkLbLUfEkIRVztPdo+MBm8UkW9Zxc20AAAAASUVORK5CYII=")e("\9");
}