1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. */
5 /* This file defines styles for form controls. The order of rule blocks is
6 * important as there are some rules with equal specificity that rely on order
7 * as a tiebreaker. These are marked with OVERRIDE. */
9 @import url
(action_link.css);
11 /* Default state **************************************************************/
15 input
[type
='submit']):not
(.custom-appearance
),
17 input
[type
='checkbox'],
19 -webkit-appearance: none
;
20 -webkit-user-select: none
;
21 background-image: -webkit-linear-gradient
(#ededed, #ededed 38%, #dedede);
22 border: 1px solid rgba
(0, 0, 0, 0.25);
24 box-shadow: 0 1px 0 rgba
(0, 0, 0, 0.08),
25 inset
0 1px 2px rgba
(255, 255, 255, 0.75);
30 text-shadow: 0 1px 0 rgb
(240, 240, 240);
35 input
[type
='submit']):not
(.custom-appearance
),
40 /* The following platform-specific rule is necessary to get adjacent
41 * buttons, text inputs, and so forth to align on their borders while also
42 * aligning on the text's baselines. */
49 input
[type
='submit']):not
(.custom-appearance
) {
50 -webkit-padding-end: 10px;
51 -webkit-padding-start: 10px;
55 -webkit-appearance: none
;
56 -webkit-padding-end: 20px;
57 -webkit-padding-start: 6px;
59 background-image: url
(../images/select.png),
60 -webkit-linear-gradient
(#ededed, #ededed 38%, #dedede);
61 background-position: right center
;
62 background-repeat: no-repeat
;
65 html
[dir
='rtl'] select
{
66 background-position: center left
;
69 input
[type
='checkbox'] {
72 vertical-align: middle
;
81 vertical-align: middle
;
85 /* TODO(estade): add more types here? */
87 input
[type
='password'],
93 border: 1px solid
#bfbfbf;
95 box-sizing: border-box
;
99 /* Use min-height to accommodate addditional padding for touch as needed. */
103 <if expr
="is_win or is_macosx or is_ios">
104 /* For better alignment between adjacent buttons and inputs. */
109 input
[type
='search'] {
110 -webkit-appearance: textfield
;
111 /* NOTE: Keep a relatively high min-width for this so we don't obscure the end
112 * of the default text in relatively spacious languages (i.e. German). */
116 /* Remove when https://bugs.webkit.org/show_bug.cgi?id=51499 is fixed.
117 * TODO(dbeam): are there more types that would benefit from this? */
118 input
[type
='search']::-webkit-textfield-decoration-container
{
122 /* Checked ********************************************************************/
124 input
[type
='checkbox']:checked::before
{
125 -webkit-user-select: none
;
126 background-image: url
(../images/check.png);
127 background-size: 100% 100%;
134 input
[type
='radio']:checked::before
{
135 background-color: #666;
146 /* Hover **********************************************************************/
148 :enabled:hover:-webkit-any
(
150 input
[type
='checkbox'],
154 input
[type
='button'],
155 input
[type
='submit']):not
(.custom-appearance
)) {
156 background-image: -webkit-linear-gradient
(#f0f0f0, #f0f0f0 38%, #e0e0e0);
157 border-color: rgba
(0, 0, 0, 0.3);
158 box-shadow: 0 1px 0 rgba
(0, 0, 0, 0.12),
159 inset
0 1px 2px rgba
(255, 255, 255, 0.95);
163 :enabled:hover:-webkit-any
(select
) {
165 background-image: url
(../images/select.png),
166 -webkit-linear-gradient
(#f0f0f0, #f0f0f0 38%, #e0e0e0);
169 /* Active *********************************************************************/
171 :enabled:active:-webkit-any
(
173 input
[type
='checkbox'],
177 input
[type
='button'],
178 input
[type
='submit']):not
(.custom-appearance
)) {
179 background-image: -webkit-linear-gradient
(#e7e7e7, #e7e7e7 38%, #d7d7d7);
184 :enabled:active:-webkit-any
(select
) {
186 background-image: url
(../images/select.png),
187 -webkit-linear-gradient
(#e7e7e7, #e7e7e7 38%, #d7d7d7);
190 /* Disabled *******************************************************************/
192 :disabled:-webkit-any
(
194 input
[type
='button'],
195 input
[type
='submit']):not
(.custom-appearance
),
197 background-image: -webkit-linear-gradient
(#f1f1f1, #f1f1f1 38%, #e6e6e6);
198 border-color: rgba
(80, 80, 80, 0.2);
199 box-shadow: 0 1px 0 rgba
(80, 80, 80, 0.08),
200 inset
0 1px 2px rgba
(255, 255, 255, 0.75);
206 background-image: url
(../images/disabled_select.png),
207 -webkit-linear-gradient
(#f1f1f1, #f1f1f1 38%, #e6e6e6);
210 input:disabled:-webkit-any
([type
='checkbox'],
215 input:disabled:-webkit-any
([type
='password'],
223 /* Focus **********************************************************************/
225 :enabled:focus:-webkit-any
(
227 input
[type
='checkbox'],
228 input
[type
='number'],
229 input
[type
='password'],
231 input
[type
='search'],
237 input
[type
='button'],
238 input
[type
='submit']):not
(.custom-appearance
)) {
240 -webkit-transition: border-color
200ms;
241 /* We use border color because it follows the border radius (unlike outline).
242 * This is particularly noticeable on mac. */
243 border-color: rgb
(77, 144, 254);
247 /* Checkbox/radio helpers ******************************************************
249 * .checkbox and .radio classes wrap labels. Checkboxes and radios should use
250 * these classes with the markup structure:
252 * <div class="checkbox">
254 * <input type="checkbox"></input>
260 :-webkit-any
(.checkbox
, .radio
) label
{
261 -webkit-user-select: none
;
262 /* Don't expand horizontally: <http://crbug.com/112091>. */
264 display: inline-flex
;
269 :-webkit-any
(.checkbox
, .radio
) label input
{
273 :-webkit-any
(.checkbox
, .radio
) label input
~ span
{
274 -webkit-margin-start: 0.6em;
275 /* Make sure long spans wrap at the same horizontal position they start. */
279 :-webkit-any
(.checkbox
, .radio
) label:hover
{
283 label
> input:disabled:-webkit-any
([type
='checkbox'], [type
='radio']) ~ span
{
288 display: inline-block
;