OLD | NEW |
---|---|
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
Dan Beam
2012/03/02 17:58:43
can we name this like form_elements.css or somethi
| |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /* Default state **************************************************************/ | |
7 | |
8 button:not(.custom-appearance):not(.link-button), | |
9 input[type='button']:not(.custom-appearance):not(.link-button), | |
10 input[type='submit']:not(.custom-appearance):not(.link-button), | |
11 select { | |
Dan Beam
2012/03/02 17:58:43
there's no .custom-appearance for selects?
Evan Stade
2012/03/02 19:46:20
no. I suppose there could be but we haven't had a
| |
12 -webkit-user-select: none; | |
13 border-radius: 2px; | |
Dan Beam
2012/03/02 17:58:43
so this intentionally changes the border-radius fr
Evan Stade
2012/03/02 19:46:20
yes
| |
14 border: 1px solid rgba(0, 0, 0, 0.25); | |
15 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), | |
16 inset 0 1px 2px rgba(255, 255, 255, 0.75); | |
17 color: #444; | |
18 font: inherit; | |
Dan Beam
2012/03/02 17:58:43
this also inherits line-height, font-weight, font-
Evan Stade
2012/03/02 19:46:20
yea. I don't think any of those will be a problem.
| |
19 height: 2em; | |
Dan Beam
2012/03/02 17:58:43
where did this come from?
Evan Stade
2012/03/02 19:46:20
in the mocks it was height: 24px. I changed it to
Dan Beam
2012/03/02 20:24:42
ok, and I take it that's the same computed value,
Evan Stade
2012/03/02 21:47:02
bingo
| |
20 margin: 0 1px 0 0; | |
21 min-width: 4em; | |
22 text-shadow: 0 1px 0 rgb(240, 240, 240); | |
23 } | |
24 | |
6 button:not(.custom-appearance):not(.link-button), | 25 button:not(.custom-appearance):not(.link-button), |
7 input[type='button']:not(.custom-appearance):not(.link-button), | 26 input[type='button']:not(.custom-appearance):not(.link-button), |
8 input[type='submit']:not(.custom-appearance):not(.link-button) { | 27 input[type='submit']:not(.custom-appearance):not(.link-button) { |
9 -webkit-border-radius: 3px; | 28 -webkit-padding-end: 10px; |
10 -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); | 29 -webkit-padding-start: 10px; |
11 -webkit-user-select: none; | 30 background-image: |
12 background: -webkit-linear-gradient(#fafafa, #f4f4f4 40%, #e5e5e5); | 31 -webkit-gradient(linear, left top, left bottom, |
13 border: 1px solid #aaa; | 32 color-stop(0, rgb(237, 237, 237)), |
14 color: #444; | 33 color-stop(0.38, rgb(237, 237, 237)), |
15 /* Input elements have -webkit-small-control which can override the body font. | 34 color-stop(1, rgb(222, 222, 222))); |
16 * Resolve this by using 'inherit'. */ | |
17 font-family: inherit; | |
18 font-size: inherit; | |
19 margin-bottom: 0; | |
20 margin-top: 0; | |
21 min-width: 4em; | |
22 padding: 3px 12px; | |
23 } | 35 } |
24 | 36 |
25 button:not(.custom-appearance):not(.link-button):hover, | 37 select { |
26 input[type='button']:not(.custom-appearance):not(.link-button):hover, | 38 -webkit-appearance: none; |
27 input[type='submit']:not(.custom-appearance):not(.link-button):hover { | 39 -webkit-padding-end: 20px; |
28 -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); | 40 -webkit-padding-start: 6px; |
29 background: #ebebeb -webkit-linear-gradient(#fefefe, #f8f8f8 40%, #e9e9e9); | 41 background-image: url("../images/select.png"), |
Dan Beam
2012/03/02 17:58:43
single quotes
Evan Stade
2012/03/02 19:46:20
Done.
| |
30 border-color: #999; | 42 -webkit-gradient(linear, left top, left bottom, |
31 color: #222; | 43 color-stop(0, rgb(237, 237, 237)), |
44 color-stop(0.38, rgb(237, 237, 237)), | |
45 color-stop(1, rgb(222, 222, 222))); | |
46 background-position: right center; | |
47 background-repeat: no-repeat; | |
48 overflow: hidden; | |
49 text-align: left; | |
50 text-overflow: ellipsis; | |
51 white-space: nowrap; | |
32 } | 52 } |
33 | 53 |
34 button:not(.custom-appearance):not(.link-button):active, | 54 html[dir='rtl'] select { |
35 input[type='button']:not(.custom-appearance):not(.link-button):active, | 55 background-position: center left; |
36 input[type='submit']:not(.custom-appearance):not(.link-button):active { | |
37 -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2); | |
38 background: #ebebeb -webkit-linear-gradient(#f4f4f4, #efefef 40%, #dcdcdc); | |
39 color: #333; | |
40 } | 56 } |
41 | 57 |
42 button[disabled]:not(.custom-appearance):not(.link-button), | 58 /* Hover **********************************************************************/ |
43 input[type='button'][disabled]:not(.custom-appearance):not(.link-button), | 59 |
44 input[type='submit'][disabled]:not(.custom-appearance):not(.link-button), | 60 button:not(.custom-appearance):not(.link-button):enabled:hover, |
45 button[disabled]:not(.custom-appearance):not(.link-button):hover, | 61 input[type='button']:not(.custom-appearance):not(.link-button):enabled:hover, |
46 input[type='button'][disabled]:not(.custom-appearance):not(.link-button):hover, | 62 input[type='submit']:not(.custom-appearance):not(.link-button):enabled:hover { |
47 input[type='submit'][disabled]:not(.custom-appearance):not(.link-button):hover { | 63 background-image: -webkit-gradient(linear, left top, left bottom, |
48 -webkit-box-shadow: none; | 64 color-stop(0, rgb(240, 240, 240)), |
49 background: -webkit-linear-gradient(#fafafa, #f4f4f4 40%, #e5e5e5); | 65 color-stop(0.38, rgb(240, 240, 240)), |
50 border-color: #aaa; | 66 color-stop(1, rgb(224, 224, 224))); |
51 color: #888; | |
52 } | 67 } |
53 | 68 |
54 /* TODO(estade): remove this. It's duplicated in chrome_shared2.css */ | 69 select:enabled:hover { |
70 background-image: url("../images/select.png"), | |
Dan Beam
2012/03/02 17:58:43
single quotes
Evan Stade
2012/03/02 19:46:20
Done.
| |
71 -webkit-gradient(linear, left top, left bottom, | |
72 color-stop(0, rgb(237, 237, 237)), | |
73 color-stop(0.38, rgb(237, 237, 237)), | |
74 color-stop(1, rgb(222, 222, 222))); | |
75 } | |
76 | |
77 button:not(.custom-appearance):not(.link-button):enabled:hover, | |
78 input[type='button']:not(.custom-appearance):not(.link-button):enabled:hover, | |
79 input[type='submit']:not(.custom-appearance):not(.link-button):enabled:hover, | |
80 select:enabled:hover { | |
81 border-color: rgba(0, 0, 0, 0.3); | |
82 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12), | |
83 inset 0 1px 2px rgba(255, 255, 255, 0.95); | |
84 color: black; | |
85 } | |
86 | |
87 /* Active *********************************************************************/ | |
88 | |
89 button:not(.custom-appearance):not(.link-button):enabled:active, | |
90 input[type='button']:not(.custom-appearance):not(.link-button):enabled:active, | |
91 input[type='submit']:not(.custom-appearance):not(.link-button):enabled:active { | |
92 background-image: -webkit-gradient(linear, left top, left bottom, | |
93 color-stop(0, rgb(231, 231, 231)), | |
94 color-stop(0.38, rgb(231, 231, 231)), | |
95 color-stop(1, rgb(215, 215, 215))); | |
96 } | |
97 | |
98 select:enabled:active { | |
99 background-image: url("../images/select.png"), | |
Dan Beam
2012/03/02 17:58:43
here too
Evan Stade
2012/03/02 19:46:20
Done.
| |
100 -webkit-gradient(linear, left top, left bottom, | |
101 color-stop(0, rgb(231, 231, 231)), | |
102 color-stop(0.38, rgb(231, 231, 231)), | |
103 color-stop(1, rgb(215, 215, 215))); | |
104 } | |
105 | |
106 button:not(.custom-appearance):not(.link-button):enabled:active, | |
107 input[type='button']:not(.custom-appearance):not(.link-button):enabled:active, | |
108 input[type='submit']:not(.custom-appearance):not(.link-button):enabled:active, | |
109 select:enabled:active { | |
110 box-shadow: none; | |
111 text-shadow: none; | |
112 } | |
113 | |
114 /* Disabled *******************************************************************/ | |
115 | |
116 button:not(.custom-appearance):not(.link-button):disabled, | |
117 input[type='button']:not(.custom-appearance):not(.link-button):disabled, | |
118 input[type='submit']:not(.custom-appearance):not(.link-button):disabled, | |
119 select:disabled { | |
120 border-color: rgba(0, 0, 0, 0.2); | |
121 color: #999; | |
122 } | |
123 | |
124 select:disabled { | |
125 background-image: url("../images/disabled_select.png"), | |
Dan Beam
2012/03/02 17:58:43
here too
Evan Stade
2012/03/02 19:46:20
Done.
| |
126 -webkit-gradient(linear, left top, left bottom, | |
127 color-stop(0, rgb(237, 237, 237)), | |
128 color-stop(0.38, rgb(237, 237, 237)), | |
129 color-stop(1, rgb(222, 222, 222))); | |
130 } | |
131 | |
132 /* Focus **********************************************************************/ | |
133 | |
55 button:not(.custom-appearance):not(.link-button):focus, | 134 button:not(.custom-appearance):not(.link-button):focus, |
56 input[type='submit']:not(.custom-appearance):not(.link-button):focus, | 135 input[type='submit']:not(.custom-appearance):focus, |
57 input[type='text']:not(.custom-appearance):not(.link-button):focus, | 136 input[type='text']:not(.custom-appearance):focus, |
58 select:not(.custom-appearance):not(.link-button):focus { | 137 select:focus { |
59 -webkit-box-shadow: inset 0 1px 2px white, | |
60 0 1px 2px rgba(0, 0, 0, .2), | |
61 0 0 1px #c0c0c0, | |
62 0 0 1px #c0c0c0, | |
63 0 0 1px #c0c0c0; | |
64 -webkit-transition: border-color 200ms; | 138 -webkit-transition: border-color 200ms; |
65 /* We use border color because it follows the border radius (unlike outline). | 139 /* We use border color because it follows the border radius (unlike outline). |
66 * This is particularly noticeable on mac. */ | 140 * This is particularly noticeable on mac. */ |
67 border-color: rgb(64, 128, 250); | 141 border-color: rgb(77, 144, 254); |
68 outline: none; | 142 outline: none; |
69 } | 143 } |
70 | 144 |
71 /* Search boxes use an outline because it follows the contours of the box. */ | 145 /* Search boxes use an outline because it follows the contours of the box. */ |
72 input[type='search']:not(.custom-appearance):not(.link-button):focus { | 146 input[type='search']:not(.custom-appearance):focus { |
73 outline-color: rgb(64, 128, 250); | 147 outline-color: rgb(77, 144, 254); |
74 } | 148 } |
75 | 149 |
150 /* Link buttons ***************************************************************/ | |
151 | |
76 .link-button { | 152 .link-button { |
77 -webkit-box-shadow: none; | 153 -webkit-box-shadow: none; |
78 background: transparent none; | 154 background: transparent none; |
79 border: none; | 155 border: none; |
80 color: rgb(17, 85, 204); | 156 color: rgb(17, 85, 204); |
81 cursor: pointer; | 157 cursor: pointer; |
82 /* Input elements have -webkit-small-control which can override the body font. | 158 /* Input elements have -webkit-small-control which can override the body font. |
83 * Resolve this by using 'inherit'. */ | 159 * Resolve this by using 'inherit'. */ |
84 font: inherit; | 160 font: inherit; |
85 margin: 0; | 161 margin: 0; |
86 padding: 0 4px; | 162 padding: 0 4px; |
87 } | 163 } |
88 | 164 |
89 .link-button:hover { | 165 .link-button:hover { |
90 text-decoration: underline; | 166 text-decoration: underline; |
91 } | 167 } |
92 | 168 |
93 .link-button:active { | 169 .link-button:active { |
94 color: rgb(5, 37, 119); | 170 color: rgb(5, 37, 119); |
95 text-decoration: underline; | 171 text-decoration: underline; |
96 } | 172 } |
97 | 173 |
98 .link-button[disabled] { | 174 .link-button[disabled] { |
99 color: #888; | 175 color: #888; |
100 cursor: default; | 176 cursor: default; |
101 text-decoration: none; | 177 text-decoration: none; |
102 } | 178 } |
OLD | NEW |