avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 1 | /* |
| 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. |
| 5 | * |
| 6 | * This stylesheet is used to apply Chrome styles to extension pages that opt in |
| 7 | * to using them. |
| 8 | * |
| 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. |
| 12 | * |
| 13 | * For example, extensions shouldn't be able to set a .link-button class and |
| 14 | * have it do anything. |
| 15 | * |
| 16 | * Other than that, keep this file and chrome_shared.css/widgets.cc in sync as |
| 17 | * much as possible. |
| 18 | */ |
| 19 | |
| 20 | body { |
| 21 | color: #333; |
| 22 | cursor: default; |
| 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 |
| 27 | * every dialogue has. |
| 28 | * |
| 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 |
| 31 | * in overlay.css). |
| 32 | * |
| 33 | * Both have a padding left/right of 17px. |
| 34 | * |
| 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. |
| 38 | */ |
| 39 | margin: 14px 17px; |
| 40 | } |
| 41 | |
| 42 | p { |
| 43 | line-height: 1.8em; |
| 44 | } |
| 45 | |
| 46 | h1, |
| 47 | h2, |
| 48 | h3 { |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 49 | user-select: none; |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 50 | font-weight: normal; |
| 51 | /* Makes the vertical size of the text the same for all fonts. */ |
| 52 | line-height: 1; |
| 53 | } |
| 54 | |
| 55 | h1 { |
| 56 | font-size: 1.5em; |
| 57 | } |
| 58 | |
| 59 | h2 { |
| 60 | font-size: 1.3em; |
| 61 | margin-bottom: 0.4em; |
| 62 | } |
| 63 | |
| 64 | h3 { |
| 65 | color: black; |
| 66 | font-size: 1.2em; |
| 67 | margin-bottom: 0.8em; |
| 68 | } |
| 69 | |
| 70 | a { |
| 71 | color: rgb(17, 85, 204); |
| 72 | text-decoration: underline; |
| 73 | } |
| 74 | |
| 75 | a:active { |
| 76 | color: rgb(5, 37, 119); |
| 77 | } |
| 78 | |
| 79 | /* Default state **************************************************************/ |
| 80 | |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 81 | :is(button, |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 82 | input[type='button'], |
| 83 | input[type='submit']), |
| 84 | select, |
| 85 | input[type='checkbox'], |
| 86 | input[type='radio'] { |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 87 | user-select: none; |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 88 | background-image: linear-gradient(#ededed, #ededed 38%, #dedede); |
| 89 | border: 1px solid rgba(0, 0, 0, 0.25); |
| 90 | border-radius: 2px; |
| 91 | box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), |
| 92 | inset 0 1px 2px rgba(255, 255, 255, 0.75); |
| 93 | color: #444; |
| 94 | font: inherit; |
| 95 | margin: 0 1px 0 0; |
| 96 | outline: none; |
| 97 | text-shadow: 0 1px 0 rgb(240, 240, 240); |
| 98 | } |
| 99 | |
Adrià Vilanova Martínez | 5120dbb | 2022-01-04 03:21:17 +0100 | [diff] [blame] | 100 | select, |
| 101 | input[type='checkbox']:not(:indeterminate), |
| 102 | input[type='radio'] { |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 103 | appearance: none; |
Adrià Vilanova Martínez | 5120dbb | 2022-01-04 03:21:17 +0100 | [diff] [blame] | 104 | } |
| 105 | |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 106 | :is(button, |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 107 | input[type='button'], |
| 108 | input[type='submit']), |
| 109 | select { |
| 110 | min-height: 2em; |
| 111 | min-width: 4em; |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 112 | } |
| 113 | |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 114 | :is(button, |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 115 | input[type='button'], |
| 116 | input[type='submit']) { |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 117 | padding-inline-end: 10px; |
| 118 | padding-inline-start: 10px; |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | select { |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 122 | appearance: none; |
| 123 | padding-inline-end: 20px; |
| 124 | padding-inline-start: 6px; |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 125 | /* OVERRIDE */ |
| 126 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAQAAACxSAwfAAAAUUlEQVR4AWP4TxREZkYxpKHAKKzKEhOZvyG4zN8SE7Eq+6+wYCHbTwiT7eeChf8VsFsKVQhTxIDDbVCFfF8ginApgyp82wRShEcZVJIVzoJDAGqrgIJGRl20AAAAAElFTkSuQmCC), |
| 127 | linear-gradient(#ededed, #ededed 38%, #dedede); |
| 128 | background-position: right center; |
| 129 | background-repeat: no-repeat; |
| 130 | } |
| 131 | |
| 132 | html[dir='rtl'] select { |
| 133 | background-position: center left; |
| 134 | } |
| 135 | |
| 136 | input[type='checkbox'] { |
| 137 | height: 13px; |
| 138 | position: relative; |
| 139 | vertical-align: middle; |
| 140 | width: 13px; |
| 141 | } |
| 142 | |
| 143 | input[type='radio'] { |
| 144 | /* OVERRIDE */ |
| 145 | border-radius: 100%; |
| 146 | height: 15px; |
| 147 | position: relative; |
| 148 | vertical-align: middle; |
| 149 | width: 15px; |
| 150 | } |
| 151 | |
| 152 | /* TODO(estade): add more types here? */ |
| 153 | input[type='number'], |
| 154 | input[type='password'], |
| 155 | input[type='search'], |
| 156 | input[type='text'], |
| 157 | input[type='url'], |
| 158 | input:not([type]), |
| 159 | textarea { |
| 160 | border: 1px solid #bfbfbf; |
| 161 | border-radius: 2px; |
| 162 | box-sizing: border-box; |
| 163 | color: #444; |
| 164 | font: inherit; |
| 165 | margin: 0; |
| 166 | /* Use min-height to accommodate addditional padding for touch as needed. */ |
| 167 | min-height: 2em; |
| 168 | padding: 3px; |
| 169 | outline: none; |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 170 | } |
| 171 | |
| 172 | input[type='search'] { |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 173 | appearance: textfield; |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 174 | /* NOTE: Keep a relatively high min-width for this so we don't obscure the end |
| 175 | * of the default text in relatively spacious languages (i.e. German). */ |
| 176 | min-width: 160px; |
| 177 | } |
| 178 | |
| 179 | /* Checked ********************************************************************/ |
| 180 | |
Adrià Vilanova Martínez | 5120dbb | 2022-01-04 03:21:17 +0100 | [diff] [blame] | 181 | input[type='checkbox']:checked:not(:indeterminate)::before { |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 182 | user-select: none; |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 183 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAQAAAADpb+tAAAAZ0lEQVR4AWNAA2xAiAXEM8xiMEAXVGJYz7AZCFEkmBi6wYKtEC4/gxqY9gILrmYQhwiXMWxkiAVyVoOFfSCCpkAmCK4Fk+1QA4GqekECUAMkka0KY9gIFvZDd5oawwyGBqACdIDqOwAQzBnTWnnU+gAAAABJRU5ErkJggg==); |
| 184 | background-size: 100% 100%; |
| 185 | content: ''; |
| 186 | display: block; |
| 187 | height: 100%; |
| 188 | width: 100%; |
| 189 | } |
| 190 | |
| 191 | input[type='radio']:checked::before { |
| 192 | background-color: #666; |
| 193 | border-radius: 100%; |
| 194 | bottom: 3px; |
| 195 | content: ''; |
| 196 | display: block; |
| 197 | left: 3px; |
| 198 | position: absolute; |
| 199 | right: 3px; |
| 200 | top: 3px; |
| 201 | } |
| 202 | |
| 203 | /* Hover **********************************************************************/ |
| 204 | |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 205 | :enabled:hover:is( |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 206 | select, |
| 207 | input[type='checkbox'], |
| 208 | input[type='radio'], |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 209 | :is( |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 210 | button, |
| 211 | input[type='button'], |
| 212 | input[type='submit'])) { |
| 213 | background-image: linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0); |
| 214 | border-color: rgba(0, 0, 0, 0.3); |
| 215 | box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12), |
| 216 | inset 0 1px 2px rgba(255, 255, 255, 0.95); |
| 217 | color: black; |
| 218 | } |
| 219 | |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 220 | :enabled:hover:is(select) { |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 221 | /* OVERRIDE */ |
| 222 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAQAAACxSAwfAAAAUUlEQVR4AWP4TxREZkYxpKHAKKzKEhOZvyG4zN8SE7Eq+6+wYCHbTwiT7eeChf8VsFsKVQhTxIDDbVCFfF8ginApgyp82wRShEcZVJIVzoJDAGqrgIJGRl20AAAAAElFTkSuQmCC), |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 223 | linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0)!important; |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 224 | } |
| 225 | |
| 226 | /* Active *********************************************************************/ |
| 227 | |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 228 | :enabled:active:is( |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 229 | select, |
| 230 | input[type='checkbox'], |
| 231 | input[type='radio'], |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 232 | :is( |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 233 | button, |
| 234 | input[type='button'], |
| 235 | input[type='submit'])) { |
| 236 | background-image: linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7); |
| 237 | box-shadow: none; |
| 238 | text-shadow: none; |
| 239 | } |
| 240 | |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 241 | :enabled:active:is(select) { |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 242 | /* OVERRIDE */ |
| 243 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAQAAACxSAwfAAAAUUlEQVR4AWP4TxREZkYxpKHAKKzKEhOZvyG4zN8SE7Eq+6+wYCHbTwiT7eeChf8VsFsKVQhTxIDDbVCFfF8ginApgyp82wRShEcZVJIVzoJDAGqrgIJGRl20AAAAAElFTkSuQmCC), |
| 244 | linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7); |
| 245 | } |
| 246 | |
| 247 | /* Disabled *******************************************************************/ |
| 248 | |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 249 | :disabled:is( |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 250 | button, |
| 251 | input[type='button'], |
| 252 | input[type='submit']), |
| 253 | select:disabled { |
| 254 | background-image: linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6); |
| 255 | border-color: rgba(80, 80, 80, 0.2); |
| 256 | box-shadow: 0 1px 0 rgba(80, 80, 80, 0.08), |
| 257 | inset 0 1px 2px rgba(255, 255, 255, 0.75); |
| 258 | color: #aaa; |
| 259 | } |
| 260 | |
| 261 | select:disabled { |
| 262 | /* OVERRIDE */ |
| 263 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAQAAACxSAwfAAAASUlEQVR4AWP4TxREZkYxpKHAKKzKEhMb/iPDxESsyv4rLFiIULRg4X8F7JaCFSIUMeBwG1QhTBEuZVCFb5tAivAog0qywllwCAAavoiLhz+UlAAAAABJRU5ErkJggg==), |
| 264 | linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6); |
| 265 | } |
| 266 | |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 267 | input:disabled:is([type='checkbox'], |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 268 | [type='radio']) { |
| 269 | opacity: .75; |
| 270 | } |
| 271 | |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 272 | input:disabled:is([type='password'], |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 273 | [type='search'], |
| 274 | [type='text'], |
| 275 | [type='url'], |
| 276 | :not([type])) { |
| 277 | color: #999; |
| 278 | } |
| 279 | |
| 280 | /* Focus **********************************************************************/ |
| 281 | |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 282 | :enabled:focus:is( |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 283 | select, |
| 284 | input[type='checkbox'], |
| 285 | input[type='number'], |
| 286 | input[type='password'], |
| 287 | input[type='radio'], |
| 288 | input[type='search'], |
| 289 | input[type='text'], |
| 290 | input[type='url'], |
| 291 | input:not([type]), |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 292 | :is( |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 293 | button, |
| 294 | input[type='button'], |
| 295 | input[type='submit'])) { |
| 296 | /* OVERRIDE */ |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 297 | transition: border-color 200ms; |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 298 | /* We use border color because it follows the border radius (unlike outline). |
| 299 | * This is particularly noticeable on mac. */ |
| 300 | border-color: rgb(77, 144, 254); |
| 301 | outline: none; |
| 302 | } |
| 303 | |
| 304 | /* Checkbox/radio helpers ****************************************************** |
| 305 | * |
| 306 | * .checkbox and .radio classes wrap labels. Checkboxes and radios should use |
| 307 | * these classes with the markup structure: |
| 308 | * |
| 309 | * <div class="checkbox"> |
| 310 | * <label> |
| 311 | * <input type="checkbox"> |
| 312 | * <span> |
| 313 | * </label> |
| 314 | * </div> |
| 315 | */ |
| 316 | |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 317 | :is(.checkbox, .radio) label { |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 318 | /* Don't expand horizontally: <http://crbug.com/112091>. */ |
| 319 | align-items: center; |
| 320 | display: inline-flex; |
| 321 | padding-bottom: 7px; |
| 322 | padding-top: 7px; |
| 323 | } |
| 324 | |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 325 | :is(.checkbox, .radio) label input { |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 326 | flex-shrink: 0; |
| 327 | } |
| 328 | |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 329 | :is(.checkbox, .radio) label input ~ span { |
| 330 | margin-inline-start: 0.6em; |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 331 | /* Make sure long spans wrap at the same horizontal position they start. */ |
| 332 | display: block; |
| 333 | } |
| 334 | |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 335 | :is(.checkbox, .radio) label:hover { |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 336 | color: black; |
| 337 | } |
| 338 | |
avm99963 | 989ddd9 | 2022-04-22 13:25:51 +0200 | [diff] [blame] | 339 | label > input:disabled:is([type='checkbox'], [type='radio']) ~ span { |
avm99963 | a23bf1e | 2020-12-25 03:02:10 +0100 | [diff] [blame] | 340 | color: #999; |
| 341 | } |