Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
personalization: Stub in grid for Google Photos albums.
Note that this CL also introduces <personalization-grid-item-element> as a generic element to perform initial styling of a grid item. It should be able to be used in Google Photos as well as in other personalization app grids. Bug: b:205315328 Change-Id: Ie2937d0379cd7847da6b85039fa875ac162875f8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3261980 Reviewed-by: Jeffrey Young <cowmoo@chromium.org> Commit-Queue: David Black <dmblack@google.com> Cr-Commit-Position: refs/heads/main@{#939494}
- Loading branch information
David Black
authored and
Chromium LUCI CQ
committed
Nov 8, 2021
1 parent
f4a136b
commit b400a7a
Showing
6 changed files
with
135 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
ash/webui/personalization_app/resources/trusted/personalization_grid_item_element.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<style include="common-style"> | ||
:host { | ||
box-sizing: border-box; | ||
display: block; | ||
height: calc( | ||
var(--personalization-app-grid-item-height) + | ||
var(--personalization-app-grid-item-spacing)); | ||
overflow: hidden; | ||
padding: calc(var(--personalization-app-grid-item-spacing) / 2); | ||
/* Subtract 0.34px to fix subpixel rounding issues with iron-list. This | ||
* ensures all grid items in a row add up to at least 1px smaller than the | ||
* parent width. */ | ||
width: calc(100% / 3 - 0.34px); | ||
} | ||
|
||
@media(min-width: 720px) { | ||
:host { | ||
/* Subtract 0.25px to fix subpixel rounding issues with iron-list. This | ||
* ensures all grid items in a row add up to at least 1px smaller than the | ||
* parent width. */ | ||
width: calc(100% / 4 - 0.25px) !important; | ||
} | ||
} | ||
|
||
:host > ::slotted(*) { | ||
border-radius: var(--personalization-app-grid-item-border-radius); | ||
box-sizing: border-box; | ||
display: block; | ||
height: 100%; | ||
overflow: hidden; | ||
width: 100%; | ||
} | ||
|
||
:host > ::slotted(*:focus-within) { | ||
outline: 2px solid var(--cros-focus-ring-color); | ||
} | ||
</style> | ||
<slot></slot> |
24 changes: 24 additions & 0 deletions
24
ash/webui/personalization_app/resources/trusted/personalization_grid_item_element.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2021 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. | ||
|
||
/** | ||
* @fileoverview Polymer element that displays a single grid item. | ||
*/ | ||
|
||
import '../common/styles.js'; | ||
import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; | ||
|
||
/** @polymer */ | ||
export class PersonalizationGridItemElement extends PolymerElement { | ||
static get is() { | ||
return 'personalization-grid-item'; | ||
} | ||
|
||
static get template() { | ||
return html`{__html_template__}`; | ||
} | ||
} | ||
|
||
customElements.define( | ||
PersonalizationGridItemElement.is, PersonalizationGridItemElement); |