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.
6 * This stylesheet is used to apply Chrome styles to extension pages that opt in
7 * to using them. These styles have been copied from
8 * ui/webui/resources/css/chrome_shared.css and
9 * ui/webui/resources/css/widgets.css. This is to prevent WebUI changes from
10 * breaking extensions, however please keep the files in sync if possible.
13 /* Prevent CSS from overriding the hidden property. */
15 display: none !important;
19 -webkit-transition-delay: 0 !important;
20 -webkit-transition-duration: 0 !important;
35 -webkit-user-select: none;
37 /* Makes the vertical size of the text the same for all fonts. */
57 color: rgb(17, 85, 204);
58 text-decoration: underline;
62 color: rgb(5, 37, 119);
65 /* Elements that need to be LTR even in an RTL context, but should align
66 * right. (Namely, URLs, search engine names, etc.)
68 html[dir='rtl'] .weakrtl {
73 /* Input fields in search engine table need to be weak-rtl. Since those input
74 * fields are generated for all cr.ListItem elements (and we only want weakrtl
75 * on some), the class needs to be on the enclosing div.
77 html[dir='rtl'] div.weakrtl input {
82 html[dir='rtl'] .favicon-cell.weakrtl {
83 -webkit-padding-end: 22px;
84 -webkit-padding-start: 0;
87 /* weakrtl for selection drop downs needs to account for the fact that
88 * Webkit does not honor the text-align attribute for the select element.
89 * (See Webkit bug #40216)
91 html[dir='rtl'] select.weakrtl {
95 html[dir='rtl'] select.weakrtl option {
99 /* WebKit does not honor alignment for text specified via placeholder attribute.
100 * This CSS is a workaround. Please remove once WebKit bug is fixed.
101 * https://bugs.webkit.org/show_bug.cgi?id=63367
103 html[dir='rtl'] input.weakrtl::-webkit-input-placeholder,
104 html[dir='rtl'] .weakrtl input::-webkit-input-placeholder {
108 /* Default state **************************************************************/
111 input[type='button'],
112 input[type='submit']):not(.custom-appearance):not(.link-button),
114 input[type='checkbox'],
115 input[type='radio'] {
116 -webkit-appearance: none;
117 -webkit-user-select: none;
118 background-image: linear-gradient(#ededed, #ededed 38%, #dedede);
119 border: 1px solid rgba(0, 0, 0, 0.25);
121 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08),
122 inset 0 1px 2px rgba(255, 255, 255, 0.75);
127 text-shadow: 0 1px 0 rgb(240, 240, 240);
131 input[type='button'],
132 input[type='submit']):not(.custom-appearance):not(.link-button),
137 /* The following platform-specific rule is necessary to get adjacent
138 * buttons, text inputs, and so forth to align on their borders while also
139 * aligning on the text's baselines. */
145 input[type='button'],
146 input[type='submit']):not(.custom-appearance):not(.link-button) {
147 -webkit-padding-end: 10px;
148 -webkit-padding-start: 10px;
152 -webkit-appearance: none;
153 -webkit-padding-end: 20px;
154 -webkit-padding-start: 6px;
156 background-image: url("../../../ui/webui/resources/images/select.png"),
157 linear-gradient(#ededed, #ededed 38%, #dedede);
158 background-position: right center;
159 background-repeat: no-repeat;
162 html[dir='rtl'] select {
163 background-position: center left;
166 input[type='checkbox'] {
170 vertical-align: middle;
174 input[type='radio'] {
180 vertical-align: middle;
184 /* TODO(estade): add more types here? */
185 input[type='number'],
186 input[type='password'],
187 input[type='search'],
192 border: 1px solid #bfbfbf;
194 box-sizing: border-box;
198 /* Use min-height to accommodate addditional padding for touch as needed. */
202 <if expr="is_win or is_macosx or is_ios">
203 /* For better alignment between adjacent buttons and inputs. */
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). */
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 {
221 /* Checked ********************************************************************/
223 input[type='checkbox']:checked::before {
224 -webkit-user-select: none;
225 background-image: url("../../../ui/webui/resources/images/check.png");
226 background-size: 100% 100%;
233 input[type='radio']:checked::before {
234 background-color: #666;
245 /* Hover **********************************************************************/
247 :enabled:hover:-webkit-any(
249 input[type='checkbox'],
253 input[type='button'],
254 input[type='submit']):not(.custom-appearance):not(.link-button)) {
255 background-image: linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
256 border-color: rgba(0, 0, 0, 0.3);
257 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12),
258 inset 0 1px 2px rgba(255, 255, 255, 0.95);
262 :enabled:hover:-webkit-any(select) {
264 background-image: url("../../../ui/webui/resources/images/select.png"),
265 linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
268 /* Active *********************************************************************/
270 :enabled:active:-webkit-any(
272 input[type='checkbox'],
276 input[type='button'],
277 input[type='submit']):not(.custom-appearance):not(.link-button)) {
278 background-image: linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
283 :enabled:active:-webkit-any(select) {
285 background-image: url("../../../ui/webui/resources/images/select.png"),
286 linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
289 /* Disabled *******************************************************************/
291 :disabled:-webkit-any(
293 input[type='button'],
294 input[type='submit']):not(.custom-appearance):not(.link-button),
296 background-image: linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6);
297 border-color: rgba(80, 80, 80, 0.2);
298 box-shadow: 0 1px 0 rgba(80, 80, 80, 0.08),
299 inset 0 1px 2px rgba(255, 255, 255, 0.75);
305 background-image: url("../../../ui/webui/resources/images/disabled_select.png"),
306 linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6);
309 input:disabled:-webkit-any([type='checkbox'],
314 input:disabled:-webkit-any([type='password'],
322 /* Focus **********************************************************************/
324 :enabled:focus:-webkit-any(
326 input[type='checkbox'],
327 input[type='number'],
328 input[type='password'],
330 input[type='search'],
336 input[type='button'],
337 input[type='submit']):not(.custom-appearance):not(.link-button)) {
339 -webkit-transition: border-color 200ms;
340 /* We use border color because it follows the border radius (unlike outline).
341 * This is particularly noticeable on mac. */
342 border-color: rgb(77, 144, 254);
346 /* Link buttons ***************************************************************/
350 background: transparent none;
352 color: rgb(17, 85, 204);
354 /* Input elements have -webkit-small-control which can override the body font.
355 * Resolve this by using 'inherit'. */
362 text-decoration: underline;
365 .link-button:active {
366 color: rgb(5, 37, 119);
367 text-decoration: underline;
370 .link-button[disabled] {
373 text-decoration: none;
376 /* Checkbox/radio helpers ******************************************************
378 * .checkbox and .radio classes wrap labels. Checkboxes and radios should use
379 * these classes with the markup structure:
381 * <div class="checkbox">
383 * <input type="checkbox"></input>
389 :-webkit-any(.checkbox, .radio) label {
390 /* Don't expand horizontally: <http://crbug.com/112091>. */
391 display: inline-flex;
396 :-webkit-any(.checkbox, .radio) label input ~ span {
397 -webkit-margin-start: 0.6em;
398 /* Make sure long spans wrap at the same horizontal position they start. */
402 :-webkit-any(.checkbox, .radio) label:hover {
406 label > input:disabled:-webkit-any([type='checkbox'], [type='radio']) ~ span {