jenkins-bot has submitted this change and it was merged.

Change subject: mw.echo.badge: Use 'background-image' rather than 'content'
......................................................................


mw.echo.badge: Use 'background-image' rather than 'content'

I think everything works the same. Some older browsers (IE 10-11,
Opera 12) have funny issues with SVGs in 'content'.

.mw-echo-notifications-badge now has 'height: 24px', as it must be
at least as high as the background to display it. We no longer need
.oo-ui-popupWidget to have 'margin-top: 7px', that was a workaround
for the badge having smaller dimensions in CSS than in reality.

This also allows us to significantly reduce the amount of Monobook-
specific CSS, because we now use the background-image approach for
all skins.

Bug: T142042
Bug: T142248
Change-Id: Iaa22202dbd5b5eb7a9b1ef47d068e80764ed982f
---
M modules/nojs/mw.echo.badge.less
M modules/nojs/mw.echo.badge.monobook.less
2 files changed, 10 insertions(+), 23 deletions(-)

Approvals:
  Mooeypoo: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/nojs/mw.echo.badge.less b/modules/nojs/mw.echo.badge.less
index 7e85883..e9dde42 100644
--- a/modules/nojs/mw.echo.badge.less
+++ b/modules/nojs/mw.echo.badge.less
@@ -8,6 +8,7 @@
                position: relative;
                display: block;
                width: 30px;
+               height: 24px;
                top: -5px;
                font-size: 0;
                cursor: pointer;
@@ -30,11 +31,12 @@
                        display: inline-block;
                        cursor: pointer;
                        opacity: 0.8;
+                       content: '';
+                       background-repeat: no-repeat;
                        left: 0;
-
-                       // Prevent IE from making the icon ridiculously big 
(T142042)
-                       width: 24px;
-                       height: 24px;
+                       top: 0;
+                       width: 100%;
+                       height: 100%;
                }
 
                // Counter
@@ -62,12 +64,9 @@
                        color: white;
                }
 
-               + .oo-ui-popupWidget {
-                       margin-top: 7px;
-               }
-
                &.mw-echo-notifications-badge-all-read {
                        opacity: 0.625;
+
                        &::after {
                                visibility: hidden;
                        }
@@ -77,14 +76,14 @@
        #pt-notifications-alert & {
                &:before {
                        /* @embed */
-                       content: url('../icons/bell.svg');
+                       background-image: url('../icons/bell.svg');
                }
        }
 
        #pt-notifications-notice & {
                &:before {
                        /* @embed */
-                       content: url('../icons/tray.svg');
+                       background-image: url('../icons/tray.svg');
                }
        }
 }
diff --git a/modules/nojs/mw.echo.badge.monobook.less 
b/modules/nojs/mw.echo.badge.monobook.less
index 7e1b2ba..9952670 100644
--- a/modules/nojs/mw.echo.badge.monobook.less
+++ b/modules/nojs/mw.echo.badge.monobook.less
@@ -6,28 +6,16 @@
        #pt-notifications-notice &,
        #pt-notifications-alert & {
                width: 20px;
+               height: 16px;
                top: -7px;
 
                &:before {
                        background-size: 16px 16px;
-                       width: 16px;
-                       height: 16px;
-                       content: "";
                }
 
                &:after {
                        top: 5px;
                }
-       }
-
-       #pt-notifications-notice &:before {
-               /* @embed */
-               background-image: url('../icons/tray.svg');
-       }
-
-       #pt-notifications-alert &:before {
-               /* @embed */
-               background-image: url('../icons/bell.svg');
        }
 
        &.oo-ui-flaggedElement-unseen,

-- 
To view, visit https://gerrit.wikimedia.org/r/303253
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaa22202dbd5b5eb7a9b1ef47d068e80764ed982f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <matma....@gmail.com>
Gerrit-Reviewer: Bartosz Dziewoński <matma....@gmail.com>
Gerrit-Reviewer: Catrope <roan.katt...@gmail.com>
Gerrit-Reviewer: Etonkovidova <etonkovid...@wikimedia.org>
Gerrit-Reviewer: Mooeypoo <mor...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to