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

Side by Side Diff: ui/webui/resources/css/widgets.css

Issue 668983004: Add <a is="action-link">, a web component extension of <a> for in-page actions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 6 years, 2 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 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 /* This file defines styles for form controls. The order of rule blocks is 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 6 * important as there are some rules with equal specificity that rely on order
7 * as a tiebreaker. These are marked with OVERRIDE. */ 7 * as a tiebreaker. These are marked with OVERRIDE. */
8 8
9 /* Default state **************************************************************/ 9 /* Default state **************************************************************/
10 10
11 :-webkit-any(button, 11 :-webkit-any(button,
12 input[type='button'], 12 input[type='button'],
13 input[type='submit']):not(.custom-appearance):not(.link-button), 13 input[type='submit']):not(.custom-appearance),
14 select, 14 select,
15 input[type='checkbox'], 15 input[type='checkbox'],
16 input[type='radio'] { 16 input[type='radio'] {
17 -webkit-appearance: none; 17 -webkit-appearance: none;
18 -webkit-user-select: none; 18 -webkit-user-select: none;
19 background-image: -webkit-linear-gradient(#ededed, #ededed 38%, #dedede); 19 background-image: -webkit-linear-gradient(#ededed, #ededed 38%, #dedede);
20 border: 1px solid rgba(0, 0, 0, 0.25); 20 border: 1px solid rgba(0, 0, 0, 0.25);
21 border-radius: 2px; 21 border-radius: 2px;
22 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 22 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08),
23 inset 0 1px 2px rgba(255, 255, 255, 0.75); 23 inset 0 1px 2px rgba(255, 255, 255, 0.75);
24 color: #444; 24 color: #444;
25 font: inherit; 25 font: inherit;
26 margin: 0 1px 0 0; 26 margin: 0 1px 0 0;
27 outline: none; 27 outline: none;
28 text-shadow: 0 1px 0 rgb(240, 240, 240); 28 text-shadow: 0 1px 0 rgb(240, 240, 240);
29 } 29 }
30 30
31 :-webkit-any(button, 31 :-webkit-any(button,
32 input[type='button'], 32 input[type='button'],
33 input[type='submit']):not(.custom-appearance):not(.link-button), 33 input[type='submit']):not(.custom-appearance),
34 select { 34 select {
35 min-height: 2em; 35 min-height: 2em;
36 min-width: 4em; 36 min-width: 4em;
37 <if expr="is_win"> 37 <if expr="is_win">
38 /* The following platform-specific rule is necessary to get adjacent 38 /* The following platform-specific rule is necessary to get adjacent
39 * buttons, text inputs, and so forth to align on their borders while also 39 * buttons, text inputs, and so forth to align on their borders while also
40 * aligning on the text's baselines. */ 40 * aligning on the text's baselines. */
41 padding-bottom: 1px; 41 padding-bottom: 1px;
42 </if> 42 </if>
43 } 43 }
44 44
45 :-webkit-any(button, 45 :-webkit-any(button,
46 input[type='button'], 46 input[type='button'],
47 input[type='submit']):not(.custom-appearance):not(.link-button) { 47 input[type='submit']):not(.custom-appearance) {
48 -webkit-padding-end: 10px; 48 -webkit-padding-end: 10px;
49 -webkit-padding-start: 10px; 49 -webkit-padding-start: 10px;
50 } 50 }
51 51
52 select { 52 select {
53 -webkit-appearance: none; 53 -webkit-appearance: none;
54 -webkit-padding-end: 20px; 54 -webkit-padding-end: 20px;
55 -webkit-padding-start: 6px; 55 -webkit-padding-start: 6px;
56 /* OVERRIDE */ 56 /* OVERRIDE */
57 background-image: url('../images/select.png'), 57 background-image: url('../images/select.png'),
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 /* Hover **********************************************************************/ 151 /* Hover **********************************************************************/
152 152
153 :enabled:hover:-webkit-any( 153 :enabled:hover:-webkit-any(
154 select, 154 select,
155 input[type='checkbox'], 155 input[type='checkbox'],
156 input[type='radio'], 156 input[type='radio'],
157 :-webkit-any( 157 :-webkit-any(
158 button, 158 button,
159 input[type='button'], 159 input[type='button'],
160 input[type='submit']):not(.custom-appearance):not(.link-button)) { 160 input[type='submit']):not(.custom-appearance)) {
161 background-image: -webkit-linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0); 161 background-image: -webkit-linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
162 border-color: rgba(0, 0, 0, 0.3); 162 border-color: rgba(0, 0, 0, 0.3);
163 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12), 163 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12),
164 inset 0 1px 2px rgba(255, 255, 255, 0.95); 164 inset 0 1px 2px rgba(255, 255, 255, 0.95);
165 color: black; 165 color: black;
166 } 166 }
167 167
168 :enabled:hover:-webkit-any(select) { 168 :enabled:hover:-webkit-any(select) {
169 /* OVERRIDE */ 169 /* OVERRIDE */
170 background-image: url('../images/select.png'), 170 background-image: url('../images/select.png'),
171 -webkit-linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0); 171 -webkit-linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
172 } 172 }
173 173
174 /* Active *********************************************************************/ 174 /* Active *********************************************************************/
175 175
176 :enabled:active:-webkit-any( 176 :enabled:active:-webkit-any(
177 select, 177 select,
178 input[type='checkbox'], 178 input[type='checkbox'],
179 input[type='radio'], 179 input[type='radio'],
180 :-webkit-any( 180 :-webkit-any(
181 button, 181 button,
182 input[type='button'], 182 input[type='button'],
183 input[type='submit']):not(.custom-appearance):not(.link-button)) { 183 input[type='submit']):not(.custom-appearance)) {
184 background-image: -webkit-linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7); 184 background-image: -webkit-linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
185 box-shadow: none; 185 box-shadow: none;
186 text-shadow: none; 186 text-shadow: none;
187 } 187 }
188 188
189 :enabled:active:-webkit-any(select) { 189 :enabled:active:-webkit-any(select) {
190 /* OVERRIDE */ 190 /* OVERRIDE */
191 background-image: url('../images/select.png'), 191 background-image: url('../images/select.png'),
192 -webkit-linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7); 192 -webkit-linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);
193 } 193 }
194 194
195 /* Disabled *******************************************************************/ 195 /* Disabled *******************************************************************/
196 196
197 :disabled:-webkit-any( 197 :disabled:-webkit-any(
198 button, 198 button,
199 input[type='button'], 199 input[type='button'],
200 input[type='submit']):not(.custom-appearance):not(.link-button), 200 input[type='submit']):not(.custom-appearance),
201 select:disabled { 201 select:disabled {
202 background-image: -webkit-linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6); 202 background-image: -webkit-linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6);
203 border-color: rgba(80, 80, 80, 0.2); 203 border-color: rgba(80, 80, 80, 0.2);
204 box-shadow: 0 1px 0 rgba(80, 80, 80, 0.08), 204 box-shadow: 0 1px 0 rgba(80, 80, 80, 0.08),
205 inset 0 1px 2px rgba(255, 255, 255, 0.75); 205 inset 0 1px 2px rgba(255, 255, 255, 0.75);
206 color: #aaa; 206 color: #aaa;
207 } 207 }
208 208
209 select:disabled { 209 select:disabled {
210 /* OVERRIDE */ 210 /* OVERRIDE */
(...skipping 22 matching lines...) Expand all
233 input[type='number'], 233 input[type='number'],
234 input[type='password'], 234 input[type='password'],
235 input[type='radio'], 235 input[type='radio'],
236 input[type='search'], 236 input[type='search'],
237 input[type='text'], 237 input[type='text'],
238 input[type='url'], 238 input[type='url'],
239 input:not([type]), 239 input:not([type]),
240 :-webkit-any( 240 :-webkit-any(
241 button, 241 button,
242 input[type='button'], 242 input[type='button'],
243 input[type='submit']):not(.custom-appearance):not(.link-button)) { 243 input[type='submit']):not(.custom-appearance)) {
244 /* OVERRIDE */ 244 /* OVERRIDE */
245 -webkit-transition: border-color 200ms; 245 -webkit-transition: border-color 200ms;
246 /* We use border color because it follows the border radius (unlike outline). 246 /* We use border color because it follows the border radius (unlike outline).
247 * This is particularly noticeable on mac. */ 247 * This is particularly noticeable on mac. */
248 border-color: rgb(77, 144, 254); 248 border-color: rgb(77, 144, 254);
249 outline: none; 249 outline: none;
250 } 250 }
251 251
252 /* Link buttons ***************************************************************/ 252 /* Action links ***************************************************************/
aboxhall 2014/10/22 21:33:31 Theoretically you could poke the style into the sh
Dan Beam 2014/10/23 03:05:44 right, saving until there's more fancy stuff we ne
253 253
254 .link-button { 254 [is='action-link'] {
255 -webkit-box-shadow: none;
256 background: transparent none;
257 border: none;
258 color: rgb(17, 85, 204);
259 cursor: pointer; 255 cursor: pointer;
260 /* Input elements have -webkit-small-control which can override the body font.
261 * Resolve this by using 'inherit'. */
262 font: inherit;
263 margin: 0;
264 padding: 0;
265 } 256 }
266 257
267 .link-button:hover { 258 [is='action-link'] {
259 text-decoration: none;
260 }
261
262 [is='action-link']:hover {
268 text-decoration: underline; 263 text-decoration: underline;
269 } 264 }
270 265
271 .link-button:active { 266 [is='action-link']:active {
272 color: rgb(5, 37, 119); 267 color: rgb(5, 37, 119);
273 text-decoration: underline; 268 text-decoration: underline;
274 } 269 }
275 270
276 .link-button[disabled] { 271 [is='action-link'][disabled] {
277 color: #999; 272 color: #999;
278 cursor: default; 273 cursor: default;
279 text-decoration: none; 274 text-decoration: none;
280 } 275 }
281 276
282 /* Checkbox/radio helpers ****************************************************** 277 /* Checkbox/radio helpers ******************************************************
283 * 278 *
284 * .checkbox and .radio classes wrap labels. Checkboxes and radios should use 279 * .checkbox and .radio classes wrap labels. Checkboxes and radios should use
285 * these classes with the markup structure: 280 * these classes with the markup structure:
286 * 281 *
(...skipping 19 matching lines...) Expand all
306 display: block; 301 display: block;
307 } 302 }
308 303
309 :-webkit-any(.checkbox, .radio) label:hover { 304 :-webkit-any(.checkbox, .radio) label:hover {
310 color: black; 305 color: black;
311 } 306 }
312 307
313 label > input:disabled:-webkit-any([type='checkbox'], [type='radio']) ~ span { 308 label > input:disabled:-webkit-any([type='checkbox'], [type='radio']) ~ span {
314 color: #999; 309 color: #999;
315 } 310 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698