Commit 1609a1f9 authored by Monica Basta's avatar Monica Basta Committed by Commit Bot

[ProfilePicker]: Improve css and dark mode support.

Screenshot:
https://drive.google.com/file/d/1Dzm0pf53Dt8vpupSamZnmApXmWRAPhoY/view?usp=sharing
https://drive.google.com/file/d/13uoDJZewRqDM5PE9cUoWtFXUFy1E1mIY/view?usp=sharing

Bug: 1063856
Change-Id: I2cbaa99ac61ea87ce1caa7a58952b7437f388769
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2339486Reviewed-by: default avatarEsmael Elmoslimany <aee@chromium.org>
Commit-Queue: Monica Basta <msalama@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795398}
parent 197dec36
<style> <style>
cr-button { cr-button {
--text-color: inherit;
background-color: rgb(248, 249, 250); background-color: rgb(248, 249, 250);
border: none; border: none;
border-radius: inherit; border-radius: inherit;
box-shadow: none; box-shadow: none;
color: var(--cr-primary-text-color);
flex-direction: column; flex-direction: column;
height: inherit; height: inherit;
padding: 0; padding: 0;
width: inherit; width: inherit;
} }
@media (prefers-color-scheme: dark) {
cr-button {
background-color: var(--google-grey-800);
}
}
:host-context(.focus-outline-visible) cr-button:focus { :host-context(.focus-outline-visible) cr-button:focus {
box-shadow: 0 0 0 2px rgba(var(--google-blue-600-rgb), .4); box-shadow: 0 0 0 2px rgba(var(--google-blue-600-rgb), .4);
} }
......
<style include="profile-picker-shared"> <style include="profile-picker-shared ">
:host { :host {
--avatar-icon-size: 74px; --avatar-icon-size: 74px;
--banner-img-height: 628px; --banner-img-height: 628px;
--banner-img-width: 250px; --banner-img-width: 250px;
--main-view-min-height: 620px;
min-height: var(--main-view-min-height);
min-width: 500px;
} }
.banner { .banner {
...@@ -25,10 +28,17 @@ ...@@ -25,10 +28,17 @@
} }
.title-container { .title-container {
margin: 30px auto; margin: 30px auto 0 auto;
text-align: center; text-align: center;
} }
#wrapper {
display: flex;
height: calc(max(100vh, var(--main-view-min-height)) - 260px);
margin-inline-end: 140px;
margin-inline-start: 140px;
}
.profiles-container { .profiles-container {
--grid-gutter: 24px; --grid-gutter: 24px;
--profile-item-height:178px; --profile-item-height:178px;
...@@ -41,13 +51,12 @@ ...@@ -41,13 +51,12 @@
grid-template-columns: repeat(auto-fit, var(--profile-item-width)); grid-template-columns: repeat(auto-fit, var(--profile-item-width));
justify-content: center; justify-content: center;
margin: auto; margin: auto;
margin-inline-end: 140px; max-height: 100%;
margin-inline-start: 140px; overflow-x: hidden;
max-height: calc((var(--profile-item-height) + var(--grid-gutter)) * 2 +
30px);
overflow-y: auto; overflow-y: auto;
padding-inline-end: var(--scrollbar-width); padding-inline-end: var(--scrollbar-width);
padding-inline-start: var(--scrollbar-width); padding-inline-start: var(--scrollbar-width);
width: 100%;
} }
.profiles-container::-webkit-scrollbar { .profiles-container::-webkit-scrollbar {
...@@ -77,7 +86,7 @@ ...@@ -77,7 +86,7 @@
#addProfile { #addProfile {
border: 1px dashed; border: 1px dashed;
border-color: var(--google-grey-400); border-color: var(--google-grey-400);
} }
cr-icon-button[iron-icon='profiles:add'] { cr-icon-button[iron-icon='profiles:add'] {
...@@ -110,21 +119,31 @@ ...@@ -110,21 +119,31 @@
} }
cr-checkbox { cr-checkbox {
--cr-checkbox-label-color: var(--google-grey-refresh-700); --cr-checkbox-label-color: var(--cr-secondary-text-color);
--cr-checkbox-label-padding-start: 8px; --cr-checkbox-label-padding-start: 8px;
justify-content: flex-end; justify-content: flex-end;
margin-inline-end: 40px; margin-inline-end: 40px;
margin-inline-start: auto; margin-inline-start: auto;
padding-inline-end: 5px;
padding-inline-start: 5px;
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
/* TODO(msalama): Dark mode mocks not ready yet.*/ .profiles-container::-webkit-scrollbar-thumb {
.footer > * { background: var(--google-grey-800);
background-color: rgba(0, 0, 0, .5); }
#addProfile {
border-color: var(--google-grey-refresh-700);
} }
cr-checkbox { cr-icon-button[iron-icon='profiles:add'] {
--cr-checkbox-label-color: var(--google-grey-refresh-500); --cr-icon-button-fill-color: var(--google-grey-refresh-500);
--cr-icon-button-stroke-color: rgb(48, 48, 50);
}
.footer > * {
background-color: rgba(0, 0, 0, .5);
} }
} }
</style> </style>
...@@ -138,16 +157,20 @@ ...@@ -138,16 +157,20 @@
<h2>$i18n{mainViewTitle}</h2> <h2>$i18n{mainViewTitle}</h2>
<h3>$i18n{mainViewSubtitle}</h3> <h3>$i18n{mainViewSubtitle}</h3>
</div> </div>
<div class="profiles-container"> <div id="wrapper">
<template is="dom-repeat" <div class="profiles-container">
hidden="[[!profilesList_]]" items="[[profilesList_]]"> <template is="dom-repeat"
<profile-card class="profile-item" profile-state="[[item]]"></profile-card> hidden="[[!profilesList_]]" items="[[profilesList_]]">
</template> <profile-card
<div id="addProfile" class="profile-item"> class="profile-item" profile-state="[[item]]">
<!-- TODO(msalama): Add title, aria-label once strings are ready--> </profile-card>
<cr-icon-button iron-icon="profiles:add" </template>
on-click="onAddProfileClick_"> <div id="addProfile" class="profile-item">
</cr-icon-button> <!-- TODO(msalama): Add title, aria-label once strings are ready-->
<cr-icon-button iron-icon="profiles:add"
on-click="onAddProfileClick_">
</cr-icon-button>
</div>
</div> </div>
</div> </div>
<div id="rightBanner" class="banner"></div> <div id="rightBanner" class="banner"></div>
......
...@@ -5,12 +5,13 @@ ...@@ -5,12 +5,13 @@
} }
h2 { h2 {
color: var(--cr-primary-text-color);
font-size: 1.85em; font-size: 1.85em;
font-weight: normal; font-weight: normal;
} }
h3 { h3 {
color: var(--google-grey-refresh-700); color: var(--cr-secondary-text-color);
font-weight: normal; font-weight: normal;
} }
</style> </style>
......
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