forked from chromium/chromium
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[personalization] added dynamic color toggle
Added a toggle to enable or disable dynamic color. This is a UI change only -- I'll hook up the toggle in a separate CL. Changes are behind the Jelly experiment. BUG=b:250955899 TESTED=https://screenshot.googleplex.com/6SDYRWs8LVisunu Change-Id: I49028b4d240c1a3f97269757f89d12d6d5247dd2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3946351 Reviewed-by: Jeffrey Young <cowmoo@chromium.org> Commit-Queue: Erica Lee <ericamlee@google.com> Cr-Commit-Position: refs/heads/main@{#1058933}
- Loading branch information
Erica Lee
authored and
Chromium LUCI CQ
committed
Oct 13, 2022
1 parent
51b095e
commit 27d3765
Showing
6 changed files
with
85 additions
and
3 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
30 changes: 30 additions & 0 deletions
30
ash/webui/personalization_app/resources/js/theme/theme_header_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,30 @@ | ||
<style include="common"> | ||
:host { | ||
color: var(--cros-text-color-primary); | ||
font: var(--personalization-app-label-font); | ||
} | ||
|
||
#theme-header { | ||
align-items: center; | ||
display: flex; | ||
margin-bottom: 16px; | ||
} | ||
|
||
#theme-title { | ||
flex-grow: 1; | ||
} | ||
|
||
#dynamic-color-toggle-description { | ||
font-weight: var(--cros-body-1-font-weight); | ||
margin-inline-end: 12px; | ||
} | ||
</style> | ||
<div id="theme-header"> | ||
<!-- TODO(b/253089237): Add the final translated text. --> | ||
<div id="theme-title">[temp]Theme color</div> | ||
<!-- TODO(b/253089237): Add the final translated text. --> | ||
<div id="dynamic-color-toggle-description">[temp]Auto</div> | ||
<!-- TODO(b/253089237): Add the translated aria label. --> | ||
<cr-toggle id="dynamic-color-toggle" checked="{{checked}}"> | ||
</cr-toggle> | ||
</div> |
39 changes: 39 additions & 0 deletions
39
ash/webui/personalization_app/resources/js/theme/theme_header_element.ts
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,39 @@ | ||
// Copyright 2022 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
/** | ||
* @fileoverview This component displays the theme header and a toggle button. | ||
*/ | ||
|
||
import '../../css/common.css.js'; | ||
import 'chrome://resources/cr_elements/cr_toggle/cr_toggle.js'; | ||
|
||
import {WithPersonalizationStore} from '../personalization_store.js'; | ||
|
||
import {getTemplate} from './theme_header_element.html.js'; | ||
|
||
export class ThemeHeader extends WithPersonalizationStore { | ||
static get is() { | ||
return 'theme-header'; | ||
} | ||
|
||
static get template() { | ||
return getTemplate(); | ||
} | ||
|
||
static get properties() { | ||
return { | ||
checked: { | ||
type: Boolean, | ||
value: true, | ||
notify: true, | ||
reflectToAttribute: true, | ||
}, | ||
}; | ||
} | ||
|
||
checked: boolean; | ||
} | ||
|
||
customElements.define(ThemeHeader.is, ThemeHeader); |