TitleOptionWidget: Only set grey bg for icons
authorEd Sanders <esanders@wikimedia.org>
Mon, 26 Oct 2015 14:51:15 +0000 (14:51 +0000)
committerEd Sanders <esanders@wikimedia.org>
Mon, 26 Oct 2015 14:58:14 +0000 (14:58 +0000)
When a thumbanil image is used leave the background
transparent, as the thumbnail may have transparency.

Bug: T116588
Change-Id: Id7bd55fcdce337cfcf3f6d9aedc798630e2983c2

resources/src/mediawiki.widgets/mw.widgets.TitleWidget.less

index 2eb8c55..86d4cfe 100644 (file)
@@ -22,7 +22,7 @@
                        min-height: 3.75em;
                        padding-left: 4.75em;
 
-                       &:not(:last-child) {
+                       &:not( :last-child ) {
                                margin-bottom: 2px;
                        }
 
                        }
 
                        &.oo-ui-iconElement {
-                               >.oo-ui-iconElement-icon {
+                               > .oo-ui-iconElement-icon {
                                        display: block;
                                        width: 3.75em;
                                        height: 3.75em;
                                        left: 0;
-                                       background-color: #ccc;
-                                       opacity: 0.4;
-                               }
-
-                               > .mw-widget-titleOptionWidget-hasImage {
-                                       border: 0;
-                                       background-size: cover;
-                                       opacity: 0.7;
+                                       &:not( .mw-widget-titleOptionWidget-hasImage ) {
+                                               background-color: #ccc;
+                                               opacity: 0.4;
+                                       }
+                                       &.mw-widget-titleOptionWidget-hasImage {
+                                               border: 0;
+                                               background-size: cover;
+                                               opacity: 0.7;
+                                       }
                                }
                        }
-               }
 
-               &.oo-ui-optionWidget-highlighted, &.oo-ui-optionWidget-selected {
-                       &.oo-ui-iconElement > .mw-widget-titleOptionWidget-hasImage {
-                               opacity: 1;
+                       &.oo-ui-optionWidget-highlighted, &.oo-ui-optionWidget-selected {
+                               &.oo-ui-iconElement > .mw-widget-titleOptionWidget-hasImage {
+                                       opacity: 1;
+                               }
                        }
                }
        }