Skip to content

Commit

Permalink
Updated theme color picker
Browse files Browse the repository at this point in the history
fix brave/brave-browser#38087

Deleted gray-default-color item from the list.
Updated default item to not have tri-color state.
  • Loading branch information
simonhong committed May 10, 2024
1 parent 0172db4 commit 18090d1
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/ui/webui/resources/cr_components/theme_color_picker/theme_color_picker.html.ts b/ui/webui/resources/cr_components/theme_color_picker/theme_color_picker.html.ts
index c041589e048eba5c3dc2595ddf9a076a52822f5d..ac2e97c82ccc0903c93130a40a04af21b30357f5 100644
--- a/ui/webui/resources/cr_components/theme_color_picker/theme_color_picker.html.ts
+++ b/ui/webui/resources/cr_components/theme_color_picker/theme_color_picker.html.ts
@@ -27,21 +27,6 @@ export function getHtml(this: ThemeColorPickerElement) {
@click="${this.onDefaultColorClick_}"
basic-color>
</cr-theme-color>
- <cr-theme-color
- id="greyDefaultColor"
- .backgroundColor="${this.greyDefaultColor_.background}"
- .baseColor="${this.greyDefaultColor_.base}"
- .foregroundColor="${this.greyDefaultColor_.foreground}"
- title="${this.i18n('greyDefaultColorName')}"
- aria-label="${this.i18n('greyDefaultColorName')}"
- role="radio"
- ?checked="${this.isGreyDefaultColorSelected_}"
- checkmark-border-hidden
- aria-checked="${this.isGreyDefaultColorSelected_}"
- tabindex="${this.tabIndex_(this.isGreyDefaultColorSelected_)}"
- @click="${this.onGreyDefaultColorClick_}"
- basic-color>
- </cr-theme-color>
${this.colors_.map((item, index) => html`
<cr-theme-color
class="chrome-color"
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/ui/webui/resources/cr_components/theme_color_picker/theme_color_picker.ts b/ui/webui/resources/cr_components/theme_color_picker/theme_color_picker.ts
index 61d40205af66ca441f0a37e6826581ba36e43eae..6025b190cac9083a44990fc1a5f7b68e3a3bf83b 100644
--- a/ui/webui/resources/cr_components/theme_color_picker/theme_color_picker.ts
+++ b/ui/webui/resources/cr_components/theme_color_picker/theme_color_picker.ts
@@ -18,7 +18,7 @@ import type {BrowserColorVariant} from '//resources/mojo/ui/base/mojom/themes.mo
import {ThemeColorPickerBrowserProxy} from './browser_proxy.js';
import {EMPTY_COLOR} from './color_utils.js';
import type {Color, SelectedColor} from './color_utils.js';
-import {ColorType, DARK_BASELINE_BLUE_COLOR, DARK_BASELINE_GREY_COLOR, LIGHT_BASELINE_BLUE_COLOR, LIGHT_BASELINE_GREY_COLOR} from './color_utils.js';
+import {ColorType, DARK_DEFAULT_COLOR, DARK_BASELINE_GREY_COLOR, LIGHT_DEFAULT_COLOR, LIGHT_BASELINE_GREY_COLOR} from './color_utils.js';
import type {ThemeColorElement} from './theme_color.js';
import {getCss} from './theme_color_picker.css.js';
import {getHtml} from './theme_color_picker.html.js';
@@ -137,8 +137,8 @@ export class ThemeColorPickerElement extends ThemeColorPickerElementBase {

private computeDefaultColor_(): Color {
assert(this.theme_);
- return this.theme_.isDarkMode ? DARK_BASELINE_BLUE_COLOR :
- LIGHT_BASELINE_BLUE_COLOR;
+ return this.theme_.isDarkMode ? DARK_DEFAULT_COLOR :
+ LIGHT_DEFAULT_COLOR;
}

private computeGreyDefaultColor_(): Color {

0 comments on commit 18090d1

Please sign in to comment.