blob: 4d3c91be2e85e56d12011f1a63bd28ba1ca0bea7 [file] [log] [blame]
avm99963a23bf1e2020-12-25 03:02:10 +01001/*
2 * Copyright 2014 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 *
6 * This stylesheet is used to apply Chrome styles to extension pages that opt in
7 * to using them.
8 *
9 * These styles have been copied from ui/webui/resources/css/chrome_shared.css
10 * and ui/webui/resources/css/widgets.css *with CSS class logic removed*, so
11 * that it's as close to a user-agent stylesheet as possible.
12 *
13 * For example, extensions shouldn't be able to set a .link-button class and
14 * have it do anything.
15 *
16 * Other than that, keep this file and chrome_shared.css/widgets.cc in sync as
17 * much as possible.
18 */
19
20body {
21 color: #333;
22 cursor: default;
23 /* Note that the correct font-family and font-size are set in
24 * extension_fonts.css. */
25 /* This top margin of 14px matches the top padding on the h1 element on
26 * overlays (see the ".overlay .page h1" selector in overlay.css), which
27 * every dialogue has.
28 *
29 * Similarly, the bottom 14px margin matches the bottom padding of the area
30 * which hosts the buttons (see the ".overlay .page * .action-area" selector
31 * in overlay.css).
32 *
33 * Both have a padding left/right of 17px.
34 *
35 * Note that we're putting this here in the Extension content, rather than
36 * the WebUI element which contains the content, so that scrollbars in the
37 * Extension content don't get a 6px margin, which looks quite odd.
38 */
39 margin: 14px 17px;
40}
41
42p {
43 line-height: 1.8em;
44}
45
46h1,
47h2,
48h3 {
49 -webkit-user-select: none;
50 font-weight: normal;
51 /* Makes the vertical size of the text the same for all fonts. */
52 line-height: 1;
53}
54
55h1 {
56 font-size: 1.5em;
57}
58
59h2 {
60 font-size: 1.3em;
61 margin-bottom: 0.4em;
62}
63
64h3 {
65 color: black;
66 font-size: 1.2em;
67 margin-bottom: 0.8em;
68}
69
70a {
71 color: rgb(17, 85, 204);
72 text-decoration: underline;
73}
74
75a:active {
76 color: rgb(5, 37, 119);
77}
78
79/* Default state **************************************************************/
80
81:-webkit-any(button,
82 input[type='button'],
83 input[type='submit']),
84select,
85input[type='checkbox'],
86input[type='radio'] {
87 -webkit-appearance: none;
88 -webkit-user-select: none;
89 background-image: linear-gradient(#ededed, #ededed 38%, #dedede);
90 border: 1px solid rgba(0, 0, 0, 0.25);
91 border-radius: 2px;
92 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08),
93 inset 0 1px 2px rgba(255, 255, 255, 0.75);
94 color: #444;
95 font: inherit;
96 margin: 0 1px 0 0;
97 outline: none;
98 text-shadow: 0 1px 0 rgb(240, 240, 240);
99}
100
101:-webkit-any(button,
102 input[type='button'],
103 input[type='submit']),
104select {
105 min-height: 2em;
106 min-width: 4em;
avm99963a23bf1e2020-12-25 03:02:10 +0100107}
108
109:-webkit-any(button,
110 input[type='button'],
111 input[type='submit']) {
112 -webkit-padding-end: 10px;
113 -webkit-padding-start: 10px;
114}
115
116select {
117 -webkit-appearance: none;
118 -webkit-padding-end: 20px;
119 -webkit-padding-start: 6px;
120 /* OVERRIDE */
121 background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAQAAACxSAwfAAAAUUlEQVR4AWP4TxREZkYxpKHAKKzKEhOZvyG4zN8SE7Eq+6+wYCHbTwiT7eeChf8VsFsKVQhTxIDDbVCFfF8ginApgyp82wRShEcZVJIVzoJDAGqrgIJGRl20AAAAAElFTkSuQmCC),
122 linear-gradient(#ededed, #ededed 38%, #dedede);
123 background-position: right center;
124 background-repeat: no-repeat;
125}
126
127html[dir='rtl'] select {
128 background-position: center left;
129}
130
131input[type='checkbox'] {
132 height: 13px;
133 position: relative;
134 vertical-align: middle;
135 width: 13px;
136}
137
138input[type='radio'] {
139 /* OVERRIDE */
140 border-radius: 100%;
141 height: 15px;
142 position: relative;
143 vertical-align: middle;
144 width: 15px;
145}
146
147/* TODO(estade): add more types here? */
148input[type='number'],
149input[type='password'],
150input[type='search'],
151input[type='text'],
152input[type='url'],
153input:not([type]),
154textarea {
155 border: 1px solid #bfbfbf;
156 border-radius: 2px;
157 box-sizing: border-box;
158 color: #444;
159 font: inherit;
160 margin: 0;
161 /* Use min-height to accommodate addditional padding for touch as needed. */
162 min-height: 2em;
163 padding: 3px;
164 outline: none;
avm99963a23bf1e2020-12-25 03:02:10 +0100165}
166
167input[type='search'] {
168 -webkit-appearance: textfield;
169 /* NOTE: Keep a relatively high min-width for this so we don't obscure the end
170 * of the default text in relatively spacious languages (i.e. German). */
171 min-width: 160px;
172}
173
174/* Checked ********************************************************************/
175
176input[type='checkbox']:checked::before {
177 -webkit-user-select: none;
178 background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAQAAAADpb+tAAAAZ0lEQVR4AWNAA2xAiAXEM8xiMEAXVGJYz7AZCFEkmBi6wYKtEC4/gxqY9gILrmYQhwiXMWxkiAVyVoOFfSCCpkAmCK4Fk+1QA4GqekECUAMkka0KY9gIFvZDd5oawwyGBqACdIDqOwAQzBnTWnnU+gAAAABJRU5ErkJggg==);
179 background-size: 100% 100%;
180 content: '';
181 display: block;
182 height: 100%;
183 width: 100%;
184}
185
186input[type='radio']:checked::before {
187 background-color: #666;
188 border-radius: 100%;
189 bottom: 3px;
190 content: '';
191 display: block;
192 left: 3px;
193 position: absolute;
194 right: 3px;
195 top: 3px;
196}
197
198/* Hover **********************************************************************/
199
200:enabled:hover:-webkit-any(
201 select,
202 input[type='checkbox'],
203 input[type='radio'],
204 :-webkit-any(
205 button,
206 input[type='button'],
207 input[type='submit'])) {
208 background-image: linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
209 border-color: rgba(0, 0, 0, 0.3);
210 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12),
211 inset 0 1px 2px rgba(255, 255, 255, 0.95);
212 color: black;
213}
214
215:enabled:hover:-webkit-any(select) {
216 /* OVERRIDE */
217 background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAQAAACxSAwfAAAAUUlEQVR4AWP4TxREZkYxpKHAKKzKEhOZvyG4zN8SE7Eq+6+wYCHbTwiT7eeChf8VsFsKVQhTxIDDbVCFfF8ginApgyp82wRShEcZVJIVzoJDAGqrgIJGRl20AAAAAElFTkSuQmCC),
218 linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
219}
220
221/* Active *********************************************************************/
222
223:enabled:active:-webkit-any(
224 select,
225 input[type='checkbox'],
226 input[type='radio'],
227 :-webkit-any(
228 button,
229 input[type='button'],
230 input[type='submit'])) {
231 background-image: linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
232 box-shadow: none;
233 text-shadow: none;
234}
235
236:enabled:active:-webkit-any(select) {
237 /* OVERRIDE */
238 background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAQAAACxSAwfAAAAUUlEQVR4AWP4TxREZkYxpKHAKKzKEhOZvyG4zN8SE7Eq+6+wYCHbTwiT7eeChf8VsFsKVQhTxIDDbVCFfF8ginApgyp82wRShEcZVJIVzoJDAGqrgIJGRl20AAAAAElFTkSuQmCC),
239 linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
240}
241
242/* Disabled *******************************************************************/
243
244:disabled:-webkit-any(
245 button,
246 input[type='button'],
247 input[type='submit']),
248select:disabled {
249 background-image: linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6);
250 border-color: rgba(80, 80, 80, 0.2);
251 box-shadow: 0 1px 0 rgba(80, 80, 80, 0.08),
252 inset 0 1px 2px rgba(255, 255, 255, 0.75);
253 color: #aaa;
254}
255
256select:disabled {
257 /* OVERRIDE */
258 background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAQAAACxSAwfAAAASUlEQVR4AWP4TxREZkYxpKHAKKzKEhMb/iPDxESsyv4rLFiIULRg4X8F7JaCFSIUMeBwG1QhTBEuZVCFb5tAivAog0qywllwCAAavoiLhz+UlAAAAABJRU5ErkJggg==),
259 linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6);
260}
261
262input:disabled:-webkit-any([type='checkbox'],
263 [type='radio']) {
264 opacity: .75;
265}
266
267input:disabled:-webkit-any([type='password'],
268 [type='search'],
269 [type='text'],
270 [type='url'],
271 :not([type])) {
272 color: #999;
273}
274
275/* Focus **********************************************************************/
276
277:enabled:focus:-webkit-any(
278 select,
279 input[type='checkbox'],
280 input[type='number'],
281 input[type='password'],
282 input[type='radio'],
283 input[type='search'],
284 input[type='text'],
285 input[type='url'],
286 input:not([type]),
287 :-webkit-any(
288 button,
289 input[type='button'],
290 input[type='submit'])) {
291 /* OVERRIDE */
292 -webkit-transition: border-color 200ms;
293 /* We use border color because it follows the border radius (unlike outline).
294 * This is particularly noticeable on mac. */
295 border-color: rgb(77, 144, 254);
296 outline: none;
297}
298
299/* Checkbox/radio helpers ******************************************************
300 *
301 * .checkbox and .radio classes wrap labels. Checkboxes and radios should use
302 * these classes with the markup structure:
303 *
304 * <div class="checkbox">
305 * <label>
306 * <input type="checkbox">
307 * <span>
308 * </label>
309 * </div>
310 */
311
312:-webkit-any(.checkbox, .radio) label {
313 /* Don't expand horizontally: <http://crbug.com/112091>. */
314 align-items: center;
315 display: inline-flex;
316 padding-bottom: 7px;
317 padding-top: 7px;
318}
319
320:-webkit-any(.checkbox, .radio) label input {
321 flex-shrink: 0;
322}
323
324:-webkit-any(.checkbox, .radio) label input ~ span {
325 -webkit-margin-start: 0.6em;
326 /* Make sure long spans wrap at the same horizontal position they start. */
327 display: block;
328}
329
330:-webkit-any(.checkbox, .radio) label:hover {
331 color: black;
332}
333
334label > input:disabled:-webkit-any([type='checkbox'], [type='radio']) ~ span {
335 color: #999;
336}