Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4666)

Unified Diff: chrome/browser/resources/local_ntp/local_ntp.css

Issue 473583002: [Local NTP] Implementing Material Design styling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/local_ntp/local_ntp.css
diff --git a/chrome/browser/resources/local_ntp/local_ntp.css b/chrome/browser/resources/local_ntp/local_ntp.css
index 9ffcb6c75f6bf142a46aa90551381129864d667f..7fe063b03bc164bc59b529068f9522c14dbbe956 100644
--- a/chrome/browser/resources/local_ntp/local_ntp.css
+++ b/chrome/browser/resources/local_ntp/local_ntp.css
@@ -1,6 +1,13 @@
/* Copyright 2013 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
+@font-face {
+ font-family: 'Roboto2';
+ font-weight: 400;
+ src: local('Roboto'), local('Roboto2-Regular'),
+ url(roboto.woff2) format('woff2'), url(roboto.woff) format('woff');
+}
+
body {
background-attachment: fixed !important;
background-color: white;
@@ -17,7 +24,7 @@ body {
.non-google-page #ntp-contents {
position: absolute;
- top: -webkit-calc(50% - 155px);
+ top: calc(50% - 155px);
width: 100%;
}
@@ -57,10 +64,10 @@ body.alternate-logo #logo {
border: 1px solid rgb(185, 185, 185);
border-radius: 1px;
border-top-color: rgb(160, 160, 160);
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
cursor: text;
font-size: 18px;
height: 36px;
+ line-height: 36px;
max-width: 620px;
position: relative;
/* #fakebox width (here and below) should be 2px less than #mv-tiles
@@ -73,6 +80,10 @@ body.alternate-logo #logo {
border-top-color: rgb(144, 144, 144);
}
+.classical #fakebox {
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+}
+
body.fakebox-focused #fakebox {
border: 1px solid rgb(77, 144, 254);
}
@@ -89,12 +100,29 @@ body.fakebox-focused #fakebox {
width: 100%;
}
-body.rtl #fakebox > input {
+body[dir=rtl] #fakebox > input {
padding-left: 0;
padding-right: 8px;
right: 0;
}
+#fakebox-text {
+ color: #bbb;
+ font-family: Roboto2, arial, sans-serif;
+ font-size: 16px;
+ height: 16px;
+ left: 9px;
+ margin-top: 1px;
+ position: absolute;
+ vertical-align: middle;
+ visibility: hidden;
+}
+
+body[dir=rtl] #fakebox-text {
+ left: auto;
+ right: 9px;
+}
+
#cursor {
background: #333;
bottom: 5px;
@@ -105,7 +133,7 @@ body.rtl #fakebox > input {
width: 1px;
}
-body.rtl #cursor {
+body[dir=rtl] #cursor {
left: auto;
right: 9px;
}
@@ -119,6 +147,11 @@ body.rtl #cursor {
}
}
+body.fakebox-drag-focused #fakebox-text,
+body.fakebox-focused #fakebox-text {
+ visibility: inherit;
+}
+
body.fakebox-drag-focused #cursor {
visibility: inherit;
}
@@ -130,53 +163,124 @@ body.fakebox-focused #cursor {
#most-visited {
-webkit-user-select: none;
- margin-top: 51px;
text-align: -webkit-center;
}
+.classical #most-visited {
+ margin-top: 51px;
+}
+
+.md #most-visited {
+ margin-top: 50px;
+}
+
#mv-tiles {
- height: calc(2 * 138px);
- line-height: 138px;
margin: 0;
position: relative;
+ text-align: left;
+}
+
+body[dir=rtl] #mv-tiles {
+ text-align: right;
+}
+
+.classical #mv-tiles {
+ height: calc(2 * 138px);
+ line-height: 138px;
+}
+
+.md #mv-tiles {
+ height: calc(2 * 126px);
+ line-height: 126px;
}
.mv-tile {
+ display: inline-block;
+ position: relative;
+ vertical-align: top;
+}
+
+.classical .mv-tile {
-webkit-transition-duration: 200ms;
-webkit-transition-property: -webkit-transform, margin, opacity, width;
background: -webkit-linear-gradient(#f2f2f2, #e8e8e8);
border: 1px solid transparent;
border-radius: 3px;
box-shadow: inset 0 2px 3px rgba(0, 0, 0, .09);
- display: inline-block;
height: 83px;
margin-left: 10px;
margin-right: 10px; /* Total horizontal margins add to TILE_MARGIN. */
- position: relative;
- vertical-align: top;
width: 138px;
}
+.md .mv-tile {
+ -webkit-transition-duration: 200ms;
+ -webkit-transition-property: -webkit-transform, outline-color, box-shadow,
+ margin, opacity, width;
+ background: #f2f2f2;
+ border-radius: 1px;
+ height: 114px;
+ margin-left: 6px;
+ margin-right: 6px;
+ width: 146px;
+}
+
+.md.dark .mv-tile {
+ background: #333;
+}
+
+.md .mv-page-ready:hover {
+ box-shadow: 0 2px 8px rgba(0,0,0,0.5);
+}
+
+.md.dark .mv-page-ready:hover,
+.md.old-hover .mv-page-ready:hover {
+ box-shadow: none;
+}
+
+.mv-tile-inner {
+ visibility: hidden;
+}
+
+.mv-page-ready .mv-tile-inner {
+ visibility: visible;
+}
+
/* Class applied to tiles to trigger the blacklist animation. */
.mv-tile.mv-blacklist {
- -webkit-transform: scale(0.5);
opacity: 0;
}
+.classical .mv-tile.mv-blacklist {
+ -webkit-transform: scale(0.5);
+}
+
+.md .mv-tile.mv-blacklist {
+ -webkit-transform: scale(0, 0);
+ -webkit-transform-origin: 0 41px;
+ margin-left: 0;
+ margin-right: 0;
+ width: 0;
+}
+
.mv-page-ready {
- border: 1px solid #c0c0c0;
cursor: pointer;
outline: none;
}
-.mv-page-ready:hover,
-.mv-page-ready:focus {
- border-color: #7f7f7f
+.classical .mv-page-ready {
+ border: 1px solid #c0c0c0;
+}
+
+.classical .mv-page-ready:hover,
+.classical .mv-page-ready:focus {
+ border-color: #7f7f7f;
}
.mv-thumb,
.mv-mask {
border: none;
+ border-radius: 2px;
cursor: pointer;
height: 83px;
left: 0;
@@ -194,25 +298,110 @@ body.fakebox-focused #cursor {
width: 140px;
}
+.md .mv-title {
+ bottom: auto;
+ height: 14px;
+ left: 28px;
+ top: 7px;
+ width: 112px;
+}
+
+body[dir=rtl] .md .mv-title {
+ left: auto;
+ right: 28px;
+}
+
+.md .mv-thumb,
+.md .mv-thumb-fallback {
+ border-radius: 0;
+ height: 82px;
+ left: 4px;
+ top: 28px;
+ width: 138px;
+}
+
+body[dir=rtl] .md .mv-thumb,
+body[dir=rtl] .md .mv-thumb-fallback {
+ left: auto;
+ right: 4px;
+}
+
+.md .mv-thumb-fallback {
+ background: #fff;
+ padding: none;
+ position: absolute;
+}
+
+.md.dark .mv-thumb-fallback {
+ background: #555;
+}
+
+.md .mv-thumb-fallback .dot {
+ background: #f2f2f2;
+ border-radius: 16px;
+ display: block;
+ height: 32px;
+ left: 50%;
+ margin-left: -16px;
+ margin-top: -16px;
+ position: absolute;
+ top: 50%;
+ width: 32px;
+}
+
+.md.dark .mv-thumb-fallback .dot {
+ background: #333;
+}
+
.mv-mask {
- opacity: 0.35;
+ background: transparent;
pointer-events: none;
}
+.classical .mv-mask {
+ box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.09);
+}
+
+.md .mv-mask {
+ border: 1px solid transparent;
+ border-radius: 2px;
+ height: 112px;
+ width: 144px;
+}
+
+.md.old-hover .mv-page-ready:hover .mv-mask {
+ border-color: #999;
+}
+.md.dark .mv-page-ready:hover .mv-mask,
+.md.old-hover.dark .mv-page-ready:hover .mv-mask {
+ border-color: #888;
+}
+
.mv-page:focus .mv-mask {
+ opacity: 0.35;
+}
+
+.classical .mv-page:focus .mv-mask {
-webkit-transition: background-color 100ms ease-in-out;
background: -webkit-linear-gradient(rgba(255, 255, 255, 0),
rgba(255, 255, 255, 0) 80%, rgba(255, 255, 255, 0.9));
background-color: black;
}
+.md .mv-page:focus .mv-mask {
+ -webkit-transition: background-color 100ms ease-in-out;
+ background: rgba(0, 0, 0, 0.9);
+ border-color: rgba(0, 0, 0, 0.9);
+}
+
.mv-x-hide .mv-x {
display: none;
}
/* An X button to blacklist a tile or hide the notification. */
.mv-x {
- background: transparent url(images/close_2.png);
+ background-color: transparent;
+ background-image: url(images/close_2.png);
border: none;
cursor: default;
height: 16px;
@@ -221,26 +410,48 @@ body.fakebox-focused #cursor {
.mv-x:hover,
#mv-notice-x:focus {
- background: transparent url(images/close_2_hover.png);
+ background-image: url(images/close_2_hover.png);
}
.mv-x:active {
- background: transparent url(images/close_2_active.png);
+ background-image: url(images/close_2_active.png);
}
.mv-page .mv-x {
-webkit-transition: opacity 150ms;
opacity: 0;
position: absolute;
+}
+
+.classical .mv-page .mv-x {
right: 2px;
top: 2px;
}
-body.rtl .mv-page .mv-x {
+.md .mv-page .mv-x {
+ right: 4px;
+ top: 5px;
+}
+
+.md .mv-x {
+ background-color: rgba(187,187,187,0.8);
+ border-radius: 8px;
+}
+
+.md.dark .mv-x {
+ background-color: rgba(119,119,119,0.8);
+}
+
+body[dir=rtl] .classical .mv-page .mv-x {
left: 2px;
right: auto;
}
+body[dir=rtl] .md .mv-page .mv-x {
+ left: 4px;
+ right: auto;
+}
+
.mv-page-ready:hover .mv-x {
-webkit-transition-delay: 500ms;
opacity: 1;
@@ -252,14 +463,28 @@ body.rtl .mv-page .mv-x {
.mv-favicon {
background-size: 16px;
- bottom: -8px;
height: 16px;
- left: 61px;
pointer-events: none;
position: absolute;
width: 16px;
}
+.classical .mv-favicon {
+ bottom: -8px;
+ left: 61px;
+}
+
+.md .mv-favicon {
+ left: 6px;
+ top: 6px;
+}
+
+body[dir=rtl] .md .mv-favicon {
+ left: auto;
+ right: 6px;
+ top: 6px;
+}
+
/* The notification shown when a tile is blacklisted. */
#mv-notice {
font-size: 12px;
@@ -287,6 +512,10 @@ body.rtl .mv-page .mv-x {
text-decoration: underline;
}
+.dark #mv-msg {
+ color: #fff;
+}
+
#mv-notice-links .mv-x {
-webkit-margin-start: 8px;
outline: none;
@@ -316,7 +545,7 @@ body.rtl .mv-page .mv-x {
z-index: -1;
}
-body.rtl #attribution {
+body[dir=rtl] #attribution {
text-align: right;
}
@@ -335,7 +564,7 @@ body.rtl #attribution {
right: 8px;
}
-body.rtl #attribution,body.rtl #recent-tabs {
+body[dir=rtl] #attribution,body[dir=rtl] #recent-tabs {
left: 8px;
right: auto;
}

Powered by Google App Engine
This is Rietveld 408576698