diff --git a/ash/webui/personalization_app/resources/BUILD.gn b/ash/webui/personalization_app/resources/BUILD.gn index 794ca25d416bc9..6a6d63cb0e2a55 100644 --- a/ash/webui/personalization_app/resources/BUILD.gn +++ b/ash/webui/personalization_app/resources/BUILD.gn @@ -88,6 +88,7 @@ web_component_files = [ "js/personalization_theme_element.ts", "js/personalization_toast_element.ts", "js/personalization_breadcrumb_element.ts", + "js/theme/theme_header_element.ts", "js/user/avatar_camera_element.ts", "js/user/avatar_list_element.ts", "js/user/user_preview_element.ts", diff --git a/ash/webui/personalization_app/resources/js/personalization_app.ts b/ash/webui/personalization_app/resources/js/personalization_app.ts index 204090ce06deb3..e117cbe6a7fe21 100644 --- a/ash/webui/personalization_app/resources/js/personalization_app.ts +++ b/ash/webui/personalization_app/resources/js/personalization_app.ts @@ -28,6 +28,7 @@ import './personalization_toast_element.js'; import './personalization_breadcrumb_element.js'; import './personalization_main_element.js'; import './personalization_theme_element.js'; +import './theme/theme_header_element.js'; import './user/avatar_camera_element.js'; import './user/avatar_list_element.js'; import './user/user_preview_element.js'; @@ -78,6 +79,7 @@ export {PersonalizationThemeElement} from './personalization_theme_element.js'; export {PersonalizationToastElement} from './personalization_toast_element.js'; export {setDarkModeEnabledAction, SetDarkModeEnabledAction, ThemeActionName, ThemeActions} from './theme/theme_actions.js'; export {setThemeProviderForTesting} from './theme/theme_interface_provider.js'; +export {ThemeHeader} from './theme/theme_header_element.js'; export {ThemeObserver} from './theme/theme_observer.js'; export {AvatarCamera, AvatarCameraMode} from './user/avatar_camera_element.js'; export {AvatarList} from './user/avatar_list_element.js'; diff --git a/ash/webui/personalization_app/resources/js/personalization_theme_element.html b/ash/webui/personalization_app/resources/js/personalization_theme_element.html index a5fc9b9e1f834f..a7c811dcb4cff1 100644 --- a/ash/webui/personalization_app/resources/js/personalization_theme_element.html +++ b/ash/webui/personalization_app/resources/js/personalization_theme_element.html @@ -42,9 +42,14 @@ }
-
-

$i18n{themeLabel}

-
+ + + :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; + } + +
+ +
[temp]Theme color
+ +
[temp]Auto
+ + + +
diff --git a/ash/webui/personalization_app/resources/js/theme/theme_header_element.ts b/ash/webui/personalization_app/resources/js/theme/theme_header_element.ts new file mode 100644 index 00000000000000..3d98aa8de4e1de --- /dev/null +++ b/ash/webui/personalization_app/resources/js/theme/theme_header_element.ts @@ -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);