summaryrefslogtreecommitdiff
blob: 87a8b5070d8f34bacd136146d282e005925bebe2 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
@import '../echo.variables.less';
@import 'mediawiki.mixins.less';

/* stylelint-disable no-descending-specificity */
/* We have to include the #pt-notifications selector due to monobook */
.mw-echo-notifications-badge {
	#pt-notifications-alert &,
	#pt-notifications-notice & {
		position: relative;
		display: block;
		width: 20px;
		height: 20px;
		margin: 0 2px;
		// Hide the text, but keep accessible for screen-readers
		// Later we put the counter back onscreen with a zero text-indent
		top: -5px;
		text-indent: -9999px;
		border-radius: @border-radius-base;
		cursor: pointer;
		text-decoration: none;
		line-height: normal;
		.box-sizing( border-box );
		opacity: 0.87;
		color: transparent;

		&:hover,
		&:active,
		&:focus {
			outline: 0;
		}

		&:focus {
			.box-shadow( ~'0 0 0 1px #fff, 0 0 0 3px #36c' );
			opacity: 1;

			&:after {
				border-color: #36c;
			}
		}

		// Counter
		&:after {
			position: absolute;
			display: inline-block;
			cursor: pointer;
			// Bring it back onscreen
			top: 9px;
			text-indent: 0;
			left: 55%;
			font-size: 0.9em;
			font-weight: bold;
			padding: 0 0.3em;
			border: 1px solid #fff;
			border-radius: @border-radius-base;
			background-color: @badge-counter-background-seen;
			content: attr( data-counter-text );
			color: #fff;
		}

		&-dimmed {
			opacity: 0.4;
		}

		&.mw-echo-notifications-badge-long-label {
			margin-right: 0.5em;

			&:after {
				left: 35%;
			}
		}

		&.mw-echo-notifications-badge-all-read {
			opacity: 0.51;

			&:after {
				visibility: hidden;
			}
		}
	}

	&.oo-ui-flaggedElement-unseen,
	&.mw-echo-unseen-notifications {
		#pt-notifications-alert &:after {
			background-color: @badge-counter-background-unseen-alert;
		}

		#pt-notifications-notice &:after {
			background-color: @badge-counter-background-unseen-message;
		}
	}
}
/* stylelint-enable no-descending-specificity */