Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Side by Side Diff: extensions/renderer/resources/extension.css

Issue 537773003: Add a user agent stylesheet for extension options pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2014 The Chromium Authors. All rights reserved. 2 * Copyright 2014 The Chromium Authors. All rights reserved.
Devlin 2014/09/04 21:27:37 This whole file is just copied from various other
ericzeng 2014/09/04 22:30:30 Done.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 * 5 *
6 * A style sheet for Chrome extensions. 6 * This stylesheet is used to apply Chrome styles to extension pages that opt in
7 */ 7 * to using them.
8 */
9
10 /* Prevent CSS from overriding the hidden property. */
11 [hidden] {
12 display: none !important;
13 }
14
15 html.loading * {
16 -webkit-transition-delay: 0 !important;
17 -webkit-transition-duration: 0 !important;
18 }
8 19
9 body { 20 body {
10 font-family: $FONTFAMILY; 21 cursor: default;
11 font-size: $FONTSIZE; 22 margin: 0;
12 } 23 }
24
25 p {
26 line-height: 1.8em;
27 }
28
29 h1,
30 h2,
31 h3 {
32 -webkit-user-select: none;
33 font-weight: normal;
34 /* Makes the vertical size of the text the same for all fonts. */
35 line-height: 1;
36 }
37
38 h1 {
39 font-size: 1.5em;
40 }
41
42 h2 {
43 font-size: 1.3em;
44 margin-bottom: 0.4em;
45 }
46
47 h3 {
48 color: black;
49 font-size: 1.2em;
50 margin-bottom: 0.8em;
51 }
52
53 a {
54 color: rgb(17, 85, 204);
55 text-decoration: underline;
56 }
57
58 a:active {
59 color: rgb(5, 37, 119);
60 }
61
62 /* Elements that need to be LTR even in an RTL context, but should align
63 * right. (Namely, URLs, search engine names, etc.)
64 */
65 html[dir='rtl'] .weakrtl {
66 direction: ltr;
67 text-align: right;
68 }
69
70 /* Input fields in search engine table need to be weak-rtl. Since those input
71 * fields are generated for all cr.ListItem elements (and we only want weakrtl
72 * on some), the class needs to be on the enclosing div.
73 */
74 html[dir='rtl'] div.weakrtl input {
75 direction: ltr;
76 text-align: right;
77 }
78
79 html[dir='rtl'] .favicon-cell.weakrtl {
80 -webkit-padding-end: 22px;
81 -webkit-padding-start: 0;
82 }
83
84 /* weakrtl for selection drop downs needs to account for the fact that
85 * Webkit does not honor the text-align attribute for the select element.
86 * (See Webkit bug #40216)
87 */
88 html[dir='rtl'] select.weakrtl {
89 direction: rtl;
90 }
91
92 html[dir='rtl'] select.weakrtl option {
93 direction: ltr;
94 }
95
96 /* WebKit does not honor alignment for text specified via placeholder attribute.
97 * This CSS is a workaround. Please remove once WebKit bug is fixed.
98 * https://bugs.webkit.org/show_bug.cgi?id=63367
99 */
100 html[dir='rtl'] input.weakrtl::-webkit-input-placeholder,
101 html[dir='rtl'] .weakrtl input::-webkit-input-placeholder {
102 direction: rtl;
103 }
104
105 /* Default state **************************************************************/
106
107 :-webkit-any(button,
108 input[type='button'],
109 input[type='submit']):not(.custom-appearance):not(.link-button),
110 select,
111 input[type='checkbox'],
112 input[type='radio'] {
113 -webkit-appearance: none;
114 -webkit-user-select: none;
115 background-image: linear-gradient(#ededed, #ededed 38%, #dedede);
116 border: 1px solid rgba(0, 0, 0, 0.25);
117 border-radius: 2px;
118 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08),
119 inset 0 1px 2px rgba(255, 255, 255, 0.75);
120 color: #444;
121 font: inherit;
122 margin: 0 1px 0 0;
123 outline: none;
124 text-shadow: 0 1px 0 rgb(240, 240, 240);
125 }
126
127 :-webkit-any(button,
128 input[type='button'],
129 input[type='submit']):not(.custom-appearance):not(.link-button),
130 select {
131 min-height: 2em;
132 min-width: 4em;
133 <if expr="is_win">
134 /* The following platform-specific rule is necessary to get adjacent
135 * buttons, text inputs, and so forth to align on their borders while also
136 * aligning on the text's baselines. */
137 padding-bottom: 1px;
138 </if>
139 }
140
141 :-webkit-any(button,
142 input[type='button'],
143 input[type='submit']):not(.custom-appearance):not(.link-button) {
144 -webkit-padding-end: 10px;
145 -webkit-padding-start: 10px;
146 }
147
148 select {
149 -webkit-appearance: none;
150 -webkit-padding-end: 20px;
151 -webkit-padding-start: 6px;
152 /* OVERRIDE */
153 background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAIC
154 AQAAACxSAwfAAAAUklEQVQY02P4z0AMRGZGMaShwCisyhITmb8huMzfEhOxKvuvsGAh208Ik+3ng
155 oX/FbBbClcIUcSAw21QhXxfIIrwKAMpfNsEUYRXGVCEFc6CQwBqq4CCCtU4VgAAAABJRU5ErkJgg
156 g=='),
157 linear-gradient(#ededed, #ededed 38%, #dedede);
158 background-position: right center;
159 background-repeat: no-repeat;
160 }
161
162 html[dir='rtl'] select {
163 background-position: center left;
164 }
165
166 input[type='checkbox'] {
167 bottom: 2px;
168 height: 13px;
169 position: relative;
170 vertical-align: middle;
171 width: 13px;
172 }
173
174 input[type='radio'] {
175 /* OVERRIDE */
176 border-radius: 100%;
177 bottom: 3px;
178 height: 15px;
179 position: relative;
180 vertical-align: middle;
181 width: 15px;
182 }
183
184 /* TODO(estade): add more types here? */
185 input[type='number'],
186 input[type='password'],
187 input[type='search'],
188 input[type='text'],
189 input[type='url'],
190 input:not([type]),
191 textarea {
192 border: 1px solid #bfbfbf;
193 border-radius: 2px;
194 box-sizing: border-box;
195 color: #444;
196 font: inherit;
197 margin: 0;
198 /* Use min-height to accommodate addditional padding for touch as needed. */
199 min-height: 2em;
200 padding: 3px;
201 outline: none;
202 <if expr="is_win or is_macosx or is_ios">
203 /* For better alignment between adjacent buttons and inputs. */
204 padding-bottom: 4px;
205 </if>
206 }
207
208 input[type='search'] {
209 -webkit-appearance: textfield;
210 /* NOTE: Keep a relatively high min-width for this so we don't obscure the end
211 * of the default text in relatively spacious languages (i.e. German). */
212 min-width: 160px;
213 }
214
215 /* Remove when https://bugs.webkit.org/show_bug.cgi?id=51499 is fixed.
216 * TODO(dbeam): are there more types that would benefit from this? */
217 input[type='search']::-webkit-textfield-decoration-container {
218 direction: inherit;
219 }
220
221 /* Checked ********************************************************************/
222
223 input[type='checkbox']:checked::before {
224 -webkit-user-select: none;
225 background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALC
226 AQAAAADpb+tAAAAaElEQVR4Xl3PIQoCQQCF4Y8JW42D1bDZ4iVEjDbxFpstYhC7eIVBZHkXFGw73
227 4sv/TqDQQ8Xb1udja/I8igeIm7Aygj2IpoKTGZnVRNxAHYi4iPiDlA9xX+aNQDFySziqDN6uSp6y
228 7ofEMwZ05uUZRkAAAAASUVORK5CYII=');
229 background-size: 100% 100%;
230 content: '';
231 display: block;
232 height: 100%;
233 width: 100%;
234 }
235
236 input[type='radio']:checked::before {
237 background-color: #666;
238 border-radius: 100%;
239 bottom: 3px;
240 content: '';
241 display: block;
242 left: 3px;
243 position: absolute;
244 right: 3px;
245 top: 3px;
246 }
247
248 /* Hover **********************************************************************/
249
250 :enabled:hover:-webkit-any(
251 select,
252 input[type='checkbox'],
253 input[type='radio'],
254 :-webkit-any(
255 button,
256 input[type='button'],
257 input[type='submit']):not(.custom-appearance):not(.link-button)) {
258 background-image: linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
259 border-color: rgba(0, 0, 0, 0.3);
260 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12),
261 inset 0 1px 2px rgba(255, 255, 255, 0.95);
262 color: black;
263 }
264
265 :enabled:hover:-webkit-any(select) {
266 /* OVERRIDE */
267 background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAIC
268 AQAAACxSAwfAAAAUklEQVQY02P4z0AMRGZGMaShwCisyhITmb8huMzfEhOxKvuvsGAh208Ik+3ng
269 oX/FbBbClcIUcSAw21QhXxfIIrwKAMpfNsEUYRXGVCEFc6CQwBqq4CCCtU4VgAAAABJRU5ErkJgg
270 g=='),
271 linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
272 }
273
274 /* Active *********************************************************************/
275
276 :enabled:active:-webkit-any(
277 select,
278 input[type='checkbox'],
279 input[type='radio'],
280 :-webkit-any(
281 button,
282 input[type='button'],
283 input[type='submit']):not(.custom-appearance):not(.link-button)) {
284 background-image: linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
285 box-shadow: none;
286 text-shadow: none;
287 }
288
289 :enabled:active:-webkit-any(select) {
290 /* OVERRIDE */
291 background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAIC
292 AQAAACxSAwfAAAAUklEQVQY02P4z0AMRGZGMaShwCisyhITmb8huMzfEhOxKvuvsGAh208Ik+3ng
293 oX/FbBbClcIUcSAw21QhXxfIIrwKAMpfNsEUYRXGVCEFc6CQwBqq4CCCtU4VgAAAABJRU5ErkJgg
294 g=='),
295 linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
296 }
297
298 /* Disabled *******************************************************************/
299
300 :disabled:-webkit-any(
301 button,
302 input[type='button'],
303 input[type='submit']):not(.custom-appearance):not(.link-button),
304 select:disabled {
305 background-image: linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6);
306 border-color: rgba(80, 80, 80, 0.2);
307 box-shadow: 0 1px 0 rgba(80, 80, 80, 0.08),
308 inset 0 1px 2px rgba(255, 255, 255, 0.75);
309 color: #aaa;
310 }
311
312 select:disabled {
313 /* OVERRIDE */
314 background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAIC
315 AQAAACxSAwfAAAASklEQVQY02P4z0AMRGZGMaShwCisyhITG/4jw8RErMr+KyxYiFC0YOF/BeyWI
316 ikEKWLA4Ta4QogiPMpACt82QRThVQYUYYWz4BAAGr6Ii6kEPacAAAAASUVORK5CYII='),
317 linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6);
318 }
319
320 input:disabled:-webkit-any([type='checkbox'],
321 [type='radio']) {
322 opacity: .75;
323 }
324
325 input:disabled:-webkit-any([type='password'],
326 [type='search'],
327 [type='text'],
328 [type='url'],
329 :not([type])) {
330 color: #999;
331 }
332
333 /* Focus **********************************************************************/
334
335 :enabled:focus:-webkit-any(
336 select,
337 input[type='checkbox'],
338 input[type='number'],
339 input[type='password'],
340 input[type='radio'],
341 input[type='search'],
342 input[type='text'],
343 input[type='url'],
344 input:not([type]),
345 :-webkit-any(
346 button,
347 input[type='button'],
348 input[type='submit']):not(.custom-appearance):not(.link-button)) {
349 /* OVERRIDE */
350 -webkit-transition: border-color 200ms;
351 /* We use border color because it follows the border radius (unlike outline).
352 * This is particularly noticeable on mac. */
353 border-color: rgb(77, 144, 254);
354 outline: none;
355 }
356
357 /* Link buttons ***************************************************************/
358
359 .link-button {
360 box-shadow: none;
361 background: transparent none;
362 border: none;
363 color: rgb(17, 85, 204);
364 cursor: pointer;
365 /* Input elements have -webkit-small-control which can override the body font.
366 * Resolve this by using 'inherit'. */
367 font: inherit;
368 margin: 0;
369 padding: 0 4px;
370 }
371
372 .link-button:hover {
373 text-decoration: underline;
374 }
375
376 .link-button:active {
377 color: rgb(5, 37, 119);
378 text-decoration: underline;
379 }
380
381 .link-button[disabled] {
382 color: #999;
383 cursor: default;
384 text-decoration: none;
385 }
386
387 /* Checkbox/radio helpers ******************************************************
388 *
389 * .checkbox and .radio classes wrap labels. Checkboxes and radios should use
390 * these classes with the markup structure:
391 *
392 * <div class="checkbox">
393 * <label>
394 * <input type="checkbox"></input>
395 * <span>
396 * </label>
397 * </div>
398 */
399
400 :-webkit-any(.checkbox, .radio) label {
401 /* Don't expand horizontally: <http://crbug.com/112091>. */
402 display: inline-flex;
403 padding-bottom: 7px;
404 padding-top: 7px;
405 }
406
407 :-webkit-any(.checkbox, .radio) label input ~ span {
408 -webkit-margin-start: 0.6em;
409 /* Make sure long spans wrap at the same horizontal position they start. */
410 display: block;
411 }
412
413 :-webkit-any(.checkbox, .radio) label:hover {
414 color: black;
415 }
416
417 label > input:disabled:-webkit-any([type='checkbox'], [type='radio']) ~ span {
418 color: #999;
419 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698