mediawiki-extensions-Echo/modules/nojs/mw.echo.badge.less
jdlrobson 150fc7a16c Drop text indent in modern Vector
In the new version of Vector the personal tools text is aligned right
rather than left. The text-indent is redundunt.

A background-position and center directive are added in preparation for
future changes we plan to the personal tools to make this code more
resilient.

Depends-On: Ic9df8c1cea0fef82461a84190689791ce2275812
Bug: T264339
Change-Id: I6bc80c8a42425599102370e5d90b48c07d360ccb
2020-10-13 20:21:57 +00:00

102 lines
2.2 KiB
Plaintext

@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;
background-repeat: no-repeat;
background-position: center center;
top: -5px;
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;
}
}
}
/* monobook (will be unnecessary when T248751 is resolved) */
.skin-monobook #pt-notifications-alert .mw-echo-notifications-badge,
.skin-monobook #pt-notifications-notice .mw-echo-notifications-badge,
/* vector */
.skin-vector-legacy .mw-echo-notifications-badge {
// Hide the text, but keep accessible for screen-readers
// Later we put the counter back onscreen with a zero text-indent
text-indent: -9999px;
}
/* stylelint-enable no-descending-specificity */