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

Side by Side Diff: chrome/browser/resources/shared/css/checkbox.css

Issue 9609023: css hack n' slash, continued: New styles for checkboxes and radios. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: csilv review Created 8 years, 9 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 | Annotate | Revision Log
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 input[type='checkbox'],
6 input[type='radio'] {
7 -webkit-box-shadow: inset 0 1px 2px white,
8 0 1px 2px rgba(0, 0, 0, .2);
9 -webkit-appearance: none;
10 -webkit-margin-start: 0;
11 -webkit-margin-end: 3px;
12 background: -webkit-linear-gradient(#fafafa, #dcdcdc);
13 border: 1px solid #a0a0a0;
14 display: inline-block;
15 margin-bottom: 0;
16 margin-top: 0;
17 position: relative;
18 }
19 5
20 input[type='checkbox']:disabled,
21 input[type='radio']:disabled {
22 opacity: .75;
23 }
24
25 input[type='checkbox'] {
26 border-radius: 3px;
27 height: 16px;
28 width: 16px;
29 }
30
31 input[type='checkbox']:not(:disabled):not(:active):hover,
32 input[type='radio']:not(:disabled):not(:active):hover {
33 background: -webkit-linear-gradient(#fff, #e6e6e6);
34 text-shadow: 0 1px 0 rgba(255, 255, 255, 1);
35 }
36
37 input[type='checkbox']:not(:disabled):active {
38 -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .2);
39 background: -webkit-linear-gradient(#f0f0f0, #bebebe);
40 border: 1px solid #808080;
41 text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
42 }
43
44 input[type='checkbox']:checked::before {
45 -webkit-user-select: none;
46 color: #808080;
47 content: url('../images/checkmark.png');
48 font-size: 13px; /* Explicitly set the font size so that the positioning
49 of the checkmark is correct. */
50 height: 16px;
51 left: 2px;
52 position: absolute;
53 }
54
55 input[type='radio'] {
56 border-radius: 100%;
57 height: 15px;
58 width: 15px;
59 }
60
61 input[type='radio']:not(:disabled):active {
62 -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .2);
63 background: -webkit-linear-gradient(#f0f0f0, #bebebe);
64 border: 1px solid #808080;
65 text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
66 }
67
68 input[type='radio']:checked::before {
69 -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, .5);
70 -webkit-margin-start: 4px;
71 background: #808080;
72 border-radius: 10px;
73 content: '';
74 display: inline-block;
75 font-size: 13px;
76 font-weight: 400;
77 height: 5px;
78 left: 0;
79 margin-top: 4px;
80 opacity: 1;
81 position: absolute;
82 top: 0;
83 vertical-align: top;
84 width: 5px;
85 }
86
87 html[dir='rtl'] input[type='radio']:checked::before {
88 right: 0;
89 }
90
91 input[type='radio']:active:checked::before {
92 background: #606060;
93 }
94
95 /* .checkbox and .radio classes wrap labels. */
96
97 .checkbox,
98 .radio {
99 margin: 9px 0;
100 }
101
102 .checkbox label,
103 .radio label {
104 /* Don't expand horizontally: http://crbug.com/112091 */
105 display: -webkit-inline-box;
106 }
107
108 .checkbox label input ~ span,
109 .radio label input ~ span {
110 -webkit-margin-start: 0.4em;
111 /* Make sure long spans wrap at the same horizontal position they start. */
112 display: block;
113 }
114
115 input[type='checkbox']:not(.custom-appearance):focus,
116 input[type='radio']:not(.custom-appearance):focus {
117 -webkit-box-shadow: inset 0 1px 2px white,
118 0 1px 2px rgba(0, 0, 0, .2),
119 0 0 1px #c0c0c0,
120 0 0 1px #c0c0c0,
121 0 0 1px #c0c0c0;
122 -webkit-transition: border-color 200ms;
123 border-color: rgb(64, 128, 250);
124 outline: none;
125 }
126
127 label > input[type=radio] ~ span,
128 label > input[type=checkbox] ~ span,
129 input[type=checkbox] ~ label {
130 color: #444;
131 }
132
133 label > input[type=checkbox]:disabled ~ span,
134 label > input[type=radio]:disabled ~ span,
135 input[type=checkbox]:disabled ~ label {
136 color: #888;
137 }
138
139 label:hover > input[type=checkbox]:not(:disabled) ~ span,
140 label:hover > input[type=radio]:not(:disabled) ~ span,
141 input[type=checkbox]:not(:disabled) ~ label:hover {
142 color: #222;
143 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/shared/css/button.css ('k') | chrome/browser/resources/shared/css/chrome_shared2.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698