2 * Copyright 2014 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
6 * This stylesheet is used to apply Chrome styles to extension pages that opt in
9 * These styles have been copied from ui/webui/resources/css/chrome_shared.css
10 * and ui/webui/resources/css/widgets.css *with CSS class logic removed*, so
11 * that it's as close to a user-agent stylesheet as possible.
13 * For example, extensions shouldn't be able to set a .link-button class and
14 * have it do anything.
16 * Other than that, keep this file and chrome_shared.css/widgets.cc in sync as
23 /* Note that the correct font-family and font-size are set in
24 * extension_fonts.css. */
25 /* This top margin of 14px matches the top padding on the h1 element on
26 * overlays (see the ".overlay .page h1" selector in overlay.css), which
29 * Similarly, the bottom 14px margin matches the bottom padding of the area
30 * which hosts the buttons (see the ".overlay .page * .action-area" selector
33 * Both have a padding left/right of 17px.
35 * Note that we're putting this here in the Extension content, rather than
36 * the WebUI element which contains the content, so that scrollbars in the
37 * Extension content don't get a 6px margin, which looks quite odd.
49 -webkit-user-select: none
;
51 /* Makes the vertical size of the text the same for all fonts. */
71 color: rgb
(17, 85, 204);
72 text-decoration: underline
;
76 color: rgb
(5, 37, 119);
79 /* Default state **************************************************************/
83 input
[type
='submit']),
85 input
[type
='checkbox'],
87 -webkit-appearance: none
;
88 -webkit-user-select: none
;
89 background-image: linear-gradient
(#ededed, #ededed 38%, #dedede);
90 border: 1px solid rgba
(0, 0, 0, 0.25);
92 box-shadow: 0 1px 0 rgba
(0, 0, 0, 0.08),
93 inset
0 1px 2px rgba
(255, 255, 255, 0.75);
98 text-shadow: 0 1px 0 rgb
(240, 240, 240);
102 input
[type
='button'],
103 input
[type
='submit']),
108 /* The following platform-specific rule is necessary to get adjacent
109 * buttons, text inputs, and so forth to align on their borders while also
110 * aligning on the text's baselines. */
116 input
[type
='button'],
117 input
[type
='submit']) {
118 -webkit-padding-end: 10px;
119 -webkit-padding-start: 10px;
123 -webkit-appearance: none
;
124 -webkit-padding-end: 20px;
125 -webkit-padding-start: 6px;
127 background-image: url
(../../../ui/webui/resources/images/select.png),
128 linear-gradient
(#ededed, #ededed 38%, #dedede);
129 background-position: right center
;
130 background-repeat: no-repeat
;
133 html
[dir
='rtl'] select
{
134 background-position: center left
;
137 input
[type
='checkbox'] {
140 vertical-align: middle
;
144 input
[type
='radio'] {
149 vertical-align: middle
;
153 /* TODO(estade): add more types here? */
154 input
[type
='number'],
155 input
[type
='password'],
156 input
[type
='search'],
161 border: 1px solid
#bfbfbf;
163 box-sizing: border-box
;
167 /* Use min-height to accommodate addditional padding for touch as needed. */
171 <if expr
="is_win or is_macosx or is_ios">
172 /* For better alignment between adjacent buttons and inputs. */
177 input
[type
='search'] {
178 -webkit-appearance: textfield
;
179 /* NOTE: Keep a relatively high min-width for this so we don't obscure the end
180 * of the default text in relatively spacious languages (i.e. German). */
184 /* Remove when https://bugs.webkit.org/show_bug.cgi?id=51499 is fixed.
185 * TODO(dbeam): are there more types that would benefit from this? */
186 input
[type
='search']::-webkit-textfield-decoration-container
{
190 /* Checked ********************************************************************/
192 input
[type
='checkbox']:checked::before
{
193 -webkit-user-select: none
;
194 background-image: url
(../../../ui/webui/resources/images/check.png);
195 background-size: 100% 100%;
202 input
[type
='radio']:checked::before
{
203 background-color: #666;
214 /* Hover **********************************************************************/
216 :enabled:hover:-webkit-any
(
218 input
[type
='checkbox'],
222 input
[type
='button'],
223 input
[type
='submit'])) {
224 background-image: linear-gradient
(#f0f0f0, #f0f0f0 38%, #e0e0e0);
225 border-color: rgba
(0, 0, 0, 0.3);
226 box-shadow: 0 1px 0 rgba
(0, 0, 0, 0.12),
227 inset
0 1px 2px rgba
(255, 255, 255, 0.95);
231 :enabled:hover:-webkit-any
(select
) {
233 background-image: url
(../../../ui/webui/resources/images/select.png),
234 linear-gradient
(#f0f0f0, #f0f0f0 38%, #e0e0e0);
237 /* Active *********************************************************************/
239 :enabled:active:-webkit-any
(
241 input
[type
='checkbox'],
245 input
[type
='button'],
246 input
[type
='submit'])) {
247 background-image: linear-gradient
(#e7e7e7, #e7e7e7 38%, #d7d7d7);
252 :enabled:active:-webkit-any
(select
) {
254 background-image: url
(../../../ui/webui/resources/images/select.png),
255 linear-gradient
(#e7e7e7, #e7e7e7 38%, #d7d7d7);
258 /* Disabled *******************************************************************/
260 :disabled:-webkit-any
(
262 input
[type
='button'],
263 input
[type
='submit']),
265 background-image: linear-gradient
(#f1f1f1, #f1f1f1 38%, #e6e6e6);
266 border-color: rgba
(80, 80, 80, 0.2);
267 box-shadow: 0 1px 0 rgba
(80, 80, 80, 0.08),
268 inset
0 1px 2px rgba
(255, 255, 255, 0.75);
274 background-image: url
(../../../ui/webui/resources/images/disabled_select.png),
275 linear-gradient
(#f1f1f1, #f1f1f1 38%, #e6e6e6);
278 input:disabled:-webkit-any
([type
='checkbox'],
283 input:disabled:-webkit-any
([type
='password'],
291 /* Focus **********************************************************************/
293 :enabled:focus:-webkit-any
(
295 input
[type
='checkbox'],
296 input
[type
='number'],
297 input
[type
='password'],
299 input
[type
='search'],
305 input
[type
='button'],
306 input
[type
='submit'])) {
308 -webkit-transition: border-color
200ms;
309 /* We use border color because it follows the border radius (unlike outline).
310 * This is particularly noticeable on mac. */
311 border-color: rgb
(77, 144, 254);
315 /* Checkbox/radio helpers ******************************************************
317 * .checkbox and .radio classes wrap labels. Checkboxes and radios should use
318 * these classes with the markup structure:
320 * <div class="checkbox">
322 * <input type="checkbox"></input>
328 :-webkit-any
(.checkbox
, .radio
) label
{
329 /* Don't expand horizontally: <http://crbug.com/112091>. */
331 display: inline-flex
;
336 :-webkit-any
(.checkbox
, .radio
) label input
{
340 :-webkit-any
(.checkbox
, .radio
) label input
~ span
{
341 -webkit-margin-start: 0.6em;
342 /* Make sure long spans wrap at the same horizontal position they start. */
346 :-webkit-any
(.checkbox
, .radio
) label:hover
{
350 label
> input:disabled:-webkit-any
([type
='checkbox'], [type
='radio']) ~ span
{