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.
6 /* This file defines styles for form controls. The order of rule blocks is
7 * important as there are some rules with equal specificity that rely on order
8 * as a tiebreaker. These are marked with OVERRIDE.
11 /* Default state **************************************************************/
15 input
[type
='submit']):not
(.custom-appearance
):not
(.link-button
),
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);
29 text-shadow: 0 1px 0 rgb
(240, 240, 240);
34 input
[type
='submit']):not
(.custom-appearance
):not
(.link-button
),
39 /* The following platform-specific rule is necessary to get adjacent
40 * buttons, text inputs, and so forth to align on their borders while also
41 * aligning on the text's baselines. */
48 input
[type
='submit']):not
(.custom-appearance
):not
(.link-button
) {
49 -webkit-padding-end: 10px;
50 -webkit-padding-start: 10px;
54 -webkit-appearance: none
;
55 -webkit-padding-end: 20px;
56 -webkit-padding-start: 6px;
58 background-image: url
('../images/select.png'),
59 -webkit-linear-gradient
(#ededed, #ededed 38%, #dedede);
60 background-position: right center
;
61 background-repeat: no-repeat
;
64 html
[dir
='rtl'] select
{
65 background-position: center left
;
68 input
[type
='checkbox'] {
72 vertical-align: middle
;
82 vertical-align: middle
;
86 /* TODO(estade): add more types here? */
87 input
[type
='password'],
94 border: 1px solid
#bfbfbf;
96 box-sizing: border-box
;
100 /* Use min-height to accommodate addditional padding for touch as needed. */
103 <if expr
="is_win or is_macosx">
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 /* Checked ********************************************************************/
118 input
[type
='checkbox']:checked::before
{
119 -webkit-user-select: none
;
120 background-image: url
('../images/check.png');
121 background-size: 100% 100%;
128 html
[dir
='rtl'] input
[type
='checkbox']:checked::before
{
129 -webkit-transform: scaleX
(-1);
132 input
[type
='radio']:checked::before
{
133 background-color: #666;
144 /* Hover **********************************************************************/
146 :enabled:hover:-webkit-any
(
148 input
[type
='checkbox'],
152 input
[type
='button'],
153 input
[type
='submit']):not
(.custom-appearance
):not
(.link-button
)) {
154 background-image: -webkit-linear-gradient
(#f0f0f0, #f0f0f0 38%, #e0e0e0);
155 border-color: rgba
(0, 0, 0, 0.3);
156 box-shadow: 0 1px 0 rgba
(0, 0, 0, 0.12),
157 inset
0 1px 2px rgba
(255, 255, 255, 0.95);
161 :enabled:hover:-webkit-any
(select
) {
163 background-image: url
('../images/select.png'),
164 -webkit-linear-gradient
(#f0f0f0, #f0f0f0 38%, #e0e0e0);
167 /* Active *********************************************************************/
169 :enabled:active:-webkit-any
(
171 input
[type
='checkbox'],
175 input
[type
='button'],
176 input
[type
='submit']):not
(.custom-appearance
):not
(.link-button
)) {
177 background-image: -webkit-linear-gradient
(#e7e7e7, #e7e7e7 38%, #d7d7d7);
182 :enabled:active:-webkit-any
(select
) {
184 background-image: url
('../images/select.png'),
185 -webkit-linear-gradient
(#e7e7e7, #e7e7e7 38%, #d7d7d7);
188 /* Disabled *******************************************************************/
190 :disabled:-webkit-any
(
192 input
[type
='button'],
193 input
[type
='submit']):not
(.custom-appearance
):not
(.link-button
),
195 background-image: -webkit-linear-gradient
(#f1f1f1, #f1f1f1 38%, #e6e6e6);
196 border-color: rgba
(80, 80, 80, 0.2);
197 box-shadow: 0 1px 0 rgba
(80, 80, 80, 0.08),
198 inset
0 1px 2px rgba
(255, 255, 255, 0.75);
204 background-image: url
('../images/disabled_select.png'),
205 -webkit-linear-gradient
(#f1f1f1, #f1f1f1 38%, #e6e6e6);
208 input:disabled:-webkit-any
([type
='checkbox'],
213 input:disabled:-webkit-any
([type
='password'],
221 /* Focus **********************************************************************/
223 :enabled:focus:-webkit-any
(
225 input
[type
='checkbox'],
226 input
[type
='password'],
228 input
[type
='search'],
234 input
[type
='button'],
235 input
[type
='submit']):not
(.custom-appearance
):not
(.link-button
)) {
237 -webkit-transition: border-color
200ms;
238 /* We use border color because it follows the border radius (unlike outline).
239 * This is particularly noticeable on mac. */
240 border-color: rgb
(77, 144, 254);
244 /* Link buttons ***************************************************************/
247 -webkit-box-shadow: none
;
248 background: transparent none
;
250 color: rgb
(17, 85, 204);
252 /* Input elements have -webkit-small-control which can override the body font.
253 * Resolve this by using 'inherit'. */
260 text-decoration: underline
;
263 .link-button:active {
264 color: rgb
(5, 37, 119);
265 text-decoration: underline
;
268 .link-button[disabled] {
271 text-decoration: none
;
274 /* Checkbox/radio helpers ******************************************************
276 * .checkbox and .radio classes wrap labels. Checkboxes and radios should use
277 * these classes with the markup structure:
279 * <div class="checkbox">
281 * <input type="checkbox"></input>
287 :-webkit-any
(.checkbox
, .radio
) label
{
288 /* Don't expand horizontally: <http://crbug.com/112091>. */
289 display: -webkit-inline-box
;
294 :-webkit-any
(.checkbox
, .radio
) label input
~ span
{
295 -webkit-margin-start: 0.6em;
296 /* Make sure long spans wrap at the same horizontal position they start. */
300 :-webkit-any
(.checkbox
, .radio
) label:hover
{
304 label
> input:disabled:-webkit-any
([type
='checkbox'], [type
='radio']) ~ span
{