From a8a18d11d9b333f2d828597d2a6fa419e0dbd816 Mon Sep 17 00:00:00 2001 From: Marina Samuel Date: Sat, 13 Jun 2015 20:26:51 -0700 Subject: [PATCH] Bug 1158858 - Move 'suggested' and 'sponsored' labels to the top left of the tile. r=Mardak --- browser/base/content/newtab/grid.js | 2 +- browser/base/content/newtab/intro.js | 6 ++-- browser/base/content/newtab/newTab.css | 38 ++++++++++++++------- browser/themes/shared/newtab/newTab.inc.css | 8 +++-- 4 files changed, 34 insertions(+), 20 deletions(-) diff --git a/browser/base/content/newtab/grid.js b/browser/base/content/newtab/grid.js index a410b67ee54..beb812e7fb7 100644 --- a/browser/base/content/newtab/grid.js +++ b/browser/base/content/newtab/grid.js @@ -159,6 +159,7 @@ let gGrid = { // Create the site's inner HTML code. site.innerHTML = + '' + newTabString("sponsored.button") + '' + '' + ' ' + ' ' + @@ -168,7 +169,6 @@ let gGrid = { ' class="newtab-control newtab-control-pin"/>' + '' + - '' + newTabString("sponsored.button") + '' + ''; this._siteFragment = document.createDocumentFragment(); diff --git a/browser/base/content/newtab/intro.js b/browser/base/content/newtab/intro.js index c26a592da24..653f73d25e7 100644 --- a/browser/base/content/newtab/intro.js +++ b/browser/base/content/newtab/intro.js @@ -166,15 +166,15 @@ let gIntro = { // Create the cell's inner HTML code. image.innerHTML = '
' + - '
' + + '
' + + ' ' + + newTabString(imageClass ? "sponsored.button" : "suggested.tag") + '' + ' ' + ' ' + ' mozilla.org' + ' ' + ' ' + ' ' + - ' ' + - newTabString(imageClass ? "sponsored.button" : "suggested.tag") + '' + '
' + '
'; break; diff --git a/browser/base/content/newtab/newTab.css b/browser/base/content/newtab/newTab.css index 7ab2215a33f..93a62ada244 100644 --- a/browser/base/content/newtab/newTab.css +++ b/browser/base/content/newtab/newTab.css @@ -207,27 +207,40 @@ input[type=button] { } .newtab-sponsored { - border: 1px solid #dcdcdc; - border-radius: 2px; + background-color: #FFFFFF; + border: 1px solid #E2E2E2; + border-radius: 3px; + color: #4A4A4A; cursor: pointer; display: none; font-family: Arial; - font-size: 10px; + font-size: 9px; height: 17px; - line-height: 17px; - margin: 5px; - padding: 0 4px; + left: 0; + line-height: 6px; + padding: 4px; + right: auto; + top: -15px; } -.newtab-sponsored:-moz-any(:hover, [active]) { - background-color: #3a72b1; +.newtab-site[suggested=true] > .newtab-sponsored { + background-color: #E2E2E2; + border: none; +} + +.newtab-site > .newtab-sponsored:-moz-any(:hover, [active]) { + background-color: #4A90E2; border: 0; color: white; } +.newtab-site > .newtab-sponsored[active] { + background-color: #000000; +} + .newtab-sponsored:-moz-locale-dir(rtl) { - left: 0; - right: auto; + right: 0; + left: auto; } .newtab-site:-moz-any([type=enhanced], [type=sponsored], [suggested]) .newtab-sponsored { @@ -645,7 +658,7 @@ input[type=button] { #newtab-intro-modal { font-family: "Helvetica"; - height: 500px; + height: 512px; position: fixed; left: 0; right: 0; @@ -721,7 +734,7 @@ input[type=button] { } #newtab-intro-body { - height: 310px; + height: 330px; position: relative; display: block; top: 50px; @@ -763,7 +776,6 @@ input[type=button] { right: 0px; font-size: 14px; line-height: 20px; - margin-top: -12px; min-width: 270px; } diff --git a/browser/themes/shared/newtab/newTab.inc.css b/browser/themes/shared/newtab/newTab.inc.css index 978332ba0e9..ce3f8834382 100644 --- a/browser/themes/shared/newtab/newTab.inc.css +++ b/browser/themes/shared/newtab/newTab.inc.css @@ -107,9 +107,10 @@ transition-property: top, left, opacity, box-shadow, background-color; } -.newtab-cell:not([ignorehover]) > .newtab-site:hover, +.newtab-cell:not([ignorehover]) .newtab-control:hover ~ .newtab-link, +.newtab-cell:not([ignorehover]) .newtab-link:hover, .newtab-site[dragged], -.newtab-intro-cell-hover { +.newtab-intro-cell-hover .newtab-link { border: 2px solid white; box-shadow: 0 0 6px 2px #4cb1ff; margin: -2px; @@ -128,7 +129,8 @@ /* LINKS */ .newtab-link { - border-radius: 6px; + border-radius: 10px; + overflow: hidden; } /* THUMBNAILS */