mediawiki-extensions-Echo/modules/nojs/mw.echo.badge.less
Stephane Bisson 01a1924187 Adjust unread counter position based on length
Move unread counter to the left (or right, in RTL)
when it's longuer than 2 characters so as to
have harmonious spacing between the counters and
the next link on the toolbar.

Bug: T142454
Change-Id: Ib8aa673cf9e60ade80490ea0eccb7453d3747cd0
2016-12-20 13:40:54 -05:00

91 lines
1.6 KiB
Plaintext

@import '../echo.variables';
@import 'mediawiki.mixins';
/* 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: 24px;
height: 24px;
top: -5px;
cursor: pointer;
text-decoration: none;
// Hide the text, but keep accessible for screen-readers
color: transparent;
&:hover,
&:active,
&:focus {
outline: none;
-moz-outline-style: none;
}
&-dimmed {
opacity: 0.4;
}
// Background icon
&:before {
position: absolute;
display: inline-block;
cursor: pointer;
opacity: 0.8;
content: '';
background-repeat: no-repeat;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
// Counter
&:after {
position: absolute;
display: inline-block;
cursor: pointer;
top: 9px;
left: 55%;
font-size: 0.9em;
font-weight: bold;
padding: 0 0.3em;
border: 1px solid #fff;
border-radius: 2px;
background-color: @badge-counter-background-seen;
content: attr( data-counter-text );
color: #fff;
}
&.mw-echo-notifications-badge-long-label {
&:after {
left: 35%;
}
}
&.mw-echo-notifications-badge-all-read {
opacity: 0.625;
&:after {
visibility: hidden;
}
}
}
#pt-notifications-alert & {
&:before {
/* @embed */
background-image: url( ../icons/bell.svg );
}
}
#pt-notifications-notice & {
&:before {
/* @embed */
background-image: url( ../icons/tray.svg );
}
}
}
/* stylelint-enable no-descending-specificity */