Commit f861610d authored by Huanzhong Huang's avatar Huanzhong Huang Committed by Commit Bot

Incognito NTP: shuffle layout of cookie controls

Screenshots:
* before: screen/GHotFhVJu1t
* after: screen/aV7D35oyJnx, screen/fszSEX5BcAV

R=huanzhong@chromium.org

Bug: 967668
Change-Id: Id766f0c655cb2dbf31c148fe0fd212370e5e787e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1841743Reviewed-by: default avatarHuanzhong Huang <huanzhong@chromium.org>
Commit-Queue: Dan Beam <dbeam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703422}
parent 6dd414bd
...@@ -96,11 +96,28 @@ em { ...@@ -96,11 +96,28 @@ em {
} }
} }
/** Third-Party Cookie Blocking Box ----------------------------------------- */ /** Cookie Controls --------------------------------------------------------- */
#cookie-controls { #cookie-controls {
align-items: center;
background-color: rgb(60, 64, 67); /* --google-grey-800 */ background-color: rgb(60, 64, 67); /* --google-grey-800 */
border-radius: 4px;
box-sizing: border-box; box-sizing: border-box;
display: flex;
padding: 12px 20px;
}
#cookie-controls-description {
flex: 1;
padding-inline-end: 20px;
}
#cookie-controls-description em {
display: block;
}
#cookie-controls-toggle {
flex: none;
} }
/** Layout ------------------------------------------------------------------ */ /** Layout ------------------------------------------------------------------ */
...@@ -162,15 +179,6 @@ h1 { ...@@ -162,15 +179,6 @@ h1 {
padding-inline-start: 16px; padding-inline-start: 16px;
} }
#cookie-controls {
margin-bottom: 1.5rem;
padding: 1.5rem;
}
#cookie-controls-description {
margin-top: 0.5rem;
}
/* Wide screens. */ /* Wide screens. */
@media (min-width: 720px) { @media (min-width: 720px) {
.icon, .icon,
...@@ -183,7 +191,8 @@ h1 { ...@@ -183,7 +191,8 @@ h1 {
.icon, .icon,
h1, h1,
#subtitle, #subtitle,
.bulletpoints { .bulletpoints,
#cookie-controls {
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
} }
...@@ -225,7 +234,8 @@ h1 { ...@@ -225,7 +234,8 @@ h1 {
.learn-more-button, .learn-more-button,
.bulletpoints, .bulletpoints,
.icon { .icon,
#cookie-controls {
margin-bottom: 16px; margin-bottom: 16px;
} }
} }
...@@ -246,7 +256,8 @@ h1 { ...@@ -246,7 +256,8 @@ h1 {
} }
.bulletpoints, .bulletpoints,
.learn-more-button { .learn-more-button,
#cookie-controls {
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
} }
...@@ -264,7 +275,8 @@ h1 { ...@@ -264,7 +275,8 @@ h1 {
} }
.bulletpoints, .bulletpoints,
.learn-more-button { .learn-more-button,
#cookie-controls {
margin-bottom: 1rem; margin-bottom: 1rem;
} }
} }
......
...@@ -31,15 +31,11 @@ document.write('<link id="incognitothemecss" rel="stylesheet" ' + ...@@ -31,15 +31,11 @@ document.write('<link id="incognitothemecss" rel="stylesheet" ' +
<div class="bulletpoints">$i18nRaw{incognitoTabWarning}</div> <div class="bulletpoints">$i18nRaw{incognitoTabWarning}</div>
</div> </div>
<div id="cookie-controls" $i18n{hiddenIfCookieControlsDisabled}> <div id="cookie-controls" $i18n{hiddenIfCookieControlsDisabled}>
<div>
<cr-toggle id="cookie-controls-toggle"></cr-toggle>
</div>
<div>
<em>$i18n{cookieControlsTitle}</em>
</div>
<div id="cookie-controls-description"> <div id="cookie-controls-description">
<em>$i18n{cookieControlsTitle}</em>
$i18n{cookieControlsDescription} $i18n{cookieControlsDescription}
</div> </div>
<cr-toggle id="cookie-controls-toggle" dark></cr-toggle>
</div> </div>
<a class="learn-more-button" href="$i18n{learnMoreLink}">$i18n{learnMore}</a> <a class="learn-more-button" href="$i18n{learnMoreLink}">$i18n{learnMore}</a>
</div> </div>
......
...@@ -33,6 +33,16 @@ ...@@ -33,6 +33,16 @@
--cr-toggle-unchecked-ink-color: var(--google-grey-refresh-300); --cr-toggle-unchecked-ink-color: var(--google-grey-refresh-300);
} }
} }
/* Keep the prefers-color-scheme and [dark] rules the same. */
:host([dark]) {
--cr-toggle-checked-bar-color: var(--google-blue-refresh-300);
--cr-toggle-checked-button-color: var(--google-blue-refresh-300);
--cr-toggle-checked-ink-color: var(--google-blue-refresh-300);
--cr-toggle-ripple-opacity: .4;
--cr-toggle-unchecked-bar-color: var(--google-grey-refresh-500);
--cr-toggle-unchecked-button-color: var(--google-grey-refresh-300);
--cr-toggle-unchecked-ink-color: var(--google-grey-refresh-300);
}
:host([disabled]) { :host([disabled]) {
cursor: initial; cursor: initial;
......
...@@ -22,6 +22,12 @@ Polymer({ ...@@ -22,6 +22,12 @@ Polymer({
notify: true, notify: true,
}, },
dark: {
type: Boolean,
value: false,
reflectToAttribute: true,
},
disabled: { disabled: {
type: Boolean, type: Boolean,
value: false, value: false,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment