summaryrefslogtreecommitdiff
blob: d8e85aecb98fe77ee5671c1d469ca271b0720945 (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
65
66
67
68
69
70
71
/* stylelint-disable indentation, selector-max-id */
@import 'mediawiki.mixins';

// Similar to from Vector's 'personalMenu.less' file.
@font-size-browser: 16; // Assumed browser default of `16px`
// ULS personal tool menu
@background-position-menu-uls-icon: left ( 1 / @font-size-browser / @font-size-menu-uls );
@background-size-menu-uls-icon: 16 / @font-size-browser / @font-size-menu-uls;
@padding-top-menu-uls-icon: 4 / @font-size-browser / @font-size-menu-uls;
@padding-left-menu-uls-icon: 20 / @font-size-browser / @font-size-menu-uls;
@font-size-menu-uls: 0.75em;

/*
 * The trigger can be placed in the personal toolbar near the username
 * or near the interlanguage links.
 */

/*
 * A hack to load the icon before the rest of the module is lazy-loaded.
 * Copied from jquery.uls.css with the path changed.
 */
.uls-trigger {
	background: no-repeat left center;
	.background-image-svg( '../../lib/jquery.uls/images/language.svg', '../../lib/jquery.uls/images/language.png' );
	// Let the SVG image fit without cropping or stretch
	background-size: contain;
	padding-left: 24px;
}

#pt-uls {
	padding-top: 0 !important; // stylelint-disable-line declaration-no-important

	.uls-trigger {
		background-image: none;
		// Same values as Vector's `#p-personal li`.
		display: inline-block;
		padding-top: 0.5em !important; // stylelint-disable-line declaration-no-important
		padding-left: 0;

		// Putting the icon in before in order to apply `opacity`.
		&:before {
			content: '';
			.background-image-svg( '../../lib/jquery.uls/images/language.svg', '../../lib/jquery.uls/images/language.png' );
			// Same values as Vector's `#pt-userpage a`.
			background-position: @background-position-menu-uls-icon;
			// Support Edge: Can't be `contain`, see T207075.
			background-repeat: no-repeat;
			background-size: @background-size-menu-uls-icon @background-size-menu-uls-icon;
			padding-top: @padding-top-menu-uls-icon;
			padding-left: @padding-left-menu-uls-icon;
			 // Equals `#555`, closest to `#54595d` on background-color `#fff`.
			opacity: 0.67;
		}
	}
}

/* Opera for some inexplicable reason confuses right and left padding with */
/* RTL text direction here (bug T47142). x:-o-prefocus won't match anything, */
/* but will make other browsers ignore this rule. */
/* stylelint-disable selector-type-no-unknown */
x:-o-prefocus,
body.rtl li#pt-uls {
	/* @noflip */
	direction: ltr;
}
/* stylelint-enable selector-type-no-unknown */

/* Don't show it to users who disabled JS */
.client-nojs #pt-uls {
	display: none;
}