-
Notifications
You must be signed in to change notification settings - Fork 6.6k
/
chrome_colors.html
120 lines (111 loc) · 3.33 KB
/
chrome_colors.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<style include="cr-hidden-style cr-icons">
#headerContainer {
align-items: center;
display: flex;
margin: 16px 16px 0;
}
cr-icon-button {
--cr-icon-button-fill-color: var(--cr-secondary-text-color);
--cr-icon-button-margin-start: -8px;
}
h1 {
color: var(--cr-primary-text-color);
font-size: 14px;
font-weight: 500;
line-height: 20px;
margin: 0;
margin-inline-start: 6px;
}
cr-grid {
--cr-column-width: 1fr;
--cr-grid-gap: 16px 12px;
--cr-grid-width: 100%;
display: block;
padding: 16px 16px 32px;
}
.tile {
cursor: pointer;
outline-width: 0;
place-self: stretch;
}
:host-context(.focus-outline-visible) #customColorContainer:focus {
box-shadow: 0 0 0 2px var(--cr-focus-outline-color);
}
#customColorContainer {
position: relative;
}
#colorPicker {
bottom: 0;
opacity: 0;
pointer-events: none;
position: absolute;
}
#colorPickerIcon {
-webkit-mask-image: url(chrome://resources/cr_components/customize_themes/colorize.svg);
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: 100%;
height: 20px;
left: calc(50% - 10px);
pointer-events: none;
position: absolute;
top: calc(50% - 10px);
width: 20px;
}
customize-chrome-color {
--customize-chrome-color-border-radius: 12px;
--customize-chrome-color-check-mark-end: -4px;
--customize-chrome-color-check-mark-size: 20px;
--customize-chrome-color-check-mark-top: -6px;
padding: 0;
}
</style>
<div id="headerContainer">
<cr-icon-button on-click="onBackClick_" id="backButton"
class="icon-arrow-back" title="$i18n{backButton}">
</cr-icon-button>
<h1 id="header">$i18n{chromeColors}</h1>
</div>
<cr-grid columns="3">
<div id="customColorContainer"
class="tile"
title="$i18n{colorPickerLabel}"
aria-label$="$i18n{colorPickerLabel}"
aria-checked$="[[isCustomColorSelected_]]"
tabindex="0"
on-click="onCustomColorClick_">
<customize-chrome-color
id="customColor"
background-color="[[customColor_.background]]"
foreground-color="[[customColor_.foreground]]"
checked="[[isCustomColorSelected_]]">
</customize-chrome-color>
<div id="colorPickerIcon"></div>
<input id="colorPicker" type="color" tabindex="-1" aria-hidden="true"
on-change="onCustomColorChange_">
</div>
<customize-chrome-color
id="defaultColor"
class="tile"
title="$i18n{defaultColorName}"
aria-label$="$i18n{defaultColorName}"
aria-checked$="[[isDefaultColorSelected_]]"
tabindex="0"
on-click="onDefaultColorClick_"
background-color="[[defaultColor_.background]]"
foreground-color="[[defaultColor_.foreground]]"
checked="[[isDefaultColorSelected_]]">
</customize-chrome-color>
<template is="dom-repeat" id="chromeColorsRepeat" items="[[colors_]]">
<customize-chrome-color
class="chrome-color tile"
title="[[item.name]]"
aria-label$="[[item.name]]"
aria-checked$="[[isChromeColorSelected_(item.seed, selectedColor_)]]"
tabindex="0"
on-click="onChromeColorClick_"
background-color="[[item.background]]"
foreground-color="[[item.foreground]]"
checked="[[isChromeColorSelected_(item.seed, selectedColor_)]]">
</customize-chrome-color>
</template>
</cr-grid>