1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* CSS Variables specific to the font editor that aren't defined by the themes */
:root {
--highlight-color: var(--blue-55);
--input-background-color: white;
--input-border-color: var(--grey-30);
--preview-input-background: var(--theme-toolbar-background);
--slider-thumb-color: var(--grey-50);
--slider-track-color: var(--grey-30);
}
:root.theme-dark {
--input-background-color: var(--grey-70);
--input-border-color: var(--grey-70);
--preview-input-background: #222225;
--slider-thumb-color: var(--grey-40);
--slider-track-color: var(--grey-60);
}
#sidebar-panel-fontinspector {
margin: 0;
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
overflow: auto;
}
#font-container,
#font-editor {
min-width: var(--min-container-width);
}
#font-container {
flex: auto;
}
#font-editor {
padding-bottom: 0.5em;
}
#font-editor summary {
user-select: none;
cursor: pointer;
margin-bottom: 0.4em;
width: -moz-fit-content;
}
#font-editor details {
padding-bottom: 0.5em;
}
#font-editor details .label-open,
#font-editor details .label-close {
display: none;
}
#font-editor details[open] .label-close,
#font-editor details:not([open]) .label-open {
display: inline-block;
}
#font-editor .devtools-sidepanel-no-result {
padding-bottom: 0;
}
.fonts-list {
padding: 0;
margin: 0;
list-style: none;
/* This is the main grid on the <ul> that the <li> will use as subgrid */
display: grid;
grid-template-columns: 1fr max-content;
grid-column-gap: 10px;
}
.font {
display: grid;
grid-template-columns: subgrid;
grid-column: 1 / -1;
padding: 10px 20px;
word-break: break-all;
& + .font {
border-block-start: 1px solid var(--theme-splitter-color);
}
.font-name {
white-space: normal;
}
}
#font-container .theme-twisty {
display: inline-block;
cursor: pointer;
vertical-align: bottom;
background-color: transparent;
border: none;
}
#font-preview-input-container {
background: var(--preview-input-background);
border-bottom: 1px solid var(--theme-splitter-color);
display: flex;
height: 25px;
}
#font-preview-input-container input {
background-image: none;
flex: 1;
padding-inline: 19px;
}
.font-preview {
grid-column: 2;
grid-row: 1 / span 2;
object-fit: contain;
height: 50px;
width: 100%;
}
.font-name,
.font-family-name {
font-weight: normal;
white-space: nowrap;
}
.font-name {
display: inline-block;
margin-bottom: 0.6em;
font-size: 1em;
color: var(--theme-text-color-alt);
}
.font-family-name {
margin-bottom: 0.2em;
font-size: 1.2em;
}
.font-group {
margin-bottom: 0.5em;
}
.font-group .font-name {
white-space: unset;
/* Some font-name can be very long, holding some kind of serial numbers and configuration.
Make sure the string wraps properly to prevent horizontal scrollbars. */
word-break: break-all;
}
.font-group .font-name::after {
content: ",";
}
.font-group .font-name:nth-last-child(1)::after {
content: "";
}
/* Make font-name hoverable as doing so highlights text runs in the page.
The hit target is 3px around the font name, which is why we offset them with a -3px
horizontal margin so they appear at the same place as they normall would. */
.font-name {
padding: 3px;
margin-inline-start: -3px;
border-radius: 3px;
overflow: hidden;
text-overflow: ellipsis;
max-height: calc(3lh + 3px);
-webkit-line-clamp: 3;
}
.font-name:hover {
background-color: var(--theme-selection-background-hover);
}
.font-css-code {
/* Force text direction in LTR and RTL */
direction: ltr;
text-align: left;
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: pre-wrap;
word-break: break-word;
text-indent: 4ch hanging each-line;
color: var(--theme-text-color-strong);
grid-column: span 2;
}
.font-css-code .theme-twisty {
margin-inline-start: -3px;
}
/* Force arrow direction in LTR and RTL */
.font-css-code .theme-twisty[aria-expanded="false"] {
transform: rotate(-90deg) !important;
}
.font-truncated-string-expander {
background-color: transparent;
border: none;
padding: 0;
&::before {
content: "\2026";
display: inline-block;
width: 12px;
height: 8px;
margin: 0 2px;
line-height: 3px;
color: var(--theme-icon-dimmed-color);
border-radius: 3px;
border-style: solid;
border-width: 1px;
text-align: center;
vertical-align: middle;
}
}
.font-control {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
padding: 0 20px;
margin: 0.6em 0;
}
/* Style *all* axis controls with a top separator. See reset below. */
.font-control-axis {
border-top: 1px solid var(--theme-splitter-color);
padding-top: 1.1em;
}
/* Remove styles form all axis controls aside from the first one.
Workaround for :first-of-type which doesn't work with class names. */
.font-control-axis ~ .font-control-axis {
border-top: unset;
padding-top: unset;
}
.font-control-used-fonts {
align-items: flex-start;
border-bottom: 1px solid var(--theme-splitter-color);
margin-block: 0 1em;
padding-top: 1em;
}
.font-control-box,
.font-control-input {
flex: 4;
min-width: 100px;
}
.font-control-input {
display: flex;
flex-wrap: nowrap;
align-items: center;
}
.font-control-input .devtools-checkbox-toggle {
margin: 2px 0;
}
.font-control-label {
display: inline-block;
flex: 1;
font-size: 12px;
min-width: 70px;
margin-inline-end: 10px;
user-select: none;
}
.font-control-label-text {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.font-control-label-detail {
color: var(--theme-text-color-alt);
font-size: smaller;
}
.font-value-input {
text-align: right;
width: 60px;
padding: 2px 3px;
padding-inline-end: 5px;
}
.font-value-input,
.font-value-select {
color: var(--theme-text-color-strong);
border: 1px solid var(--input-border-color);
background-color: var(--input-background-color);
}
/* Styles for disabled input fields */
.font-value-input[disabled],
.font-value-select[disabled],
.font-value-slider[disabled] {
opacity: 0.5;
}
/* Do not use browser "invalid" state */
.font-value-slider:-moz-ui-invalid,
.font-value-input:-moz-ui-invalid {
box-shadow: none;
}
/* Do not show dotted line focus outline */
.font-value-input:-moz-focusring {
outline: none;
}
/* Make native number steppers disappear by treating it as text field*/
.font-value-input[type="number"] {
appearance: textfield;
}
/* Swap around order of value input and unit dropdown for RTL */
.font-value-input:dir(rtl) {
order: 3;
}
.font-value-label {
/* Combined width of .font-value-input and .font-value-select */
width: calc(60px + 3.8em);
padding-block: 2px 4px;
}
/* Mock separator because inputs don't have distinguishable borders in dark theme */
.theme-dark .font-value-input + .font-value-select:dir(ltr) {
margin-inline-start: 2px;
}
.theme-dark .font-value-input + .font-value-select:dir(rtl) {
margin-inline-end: 2px;
}
/* Custom styles for <select> elements within the font editor. */
.font-value-select {
background-image: url(chrome://devtools/skin/images/select-arrow.svg);
background-repeat: no-repeat;
background-position: right 4px center;
fill: var(--theme-icon-color);
-moz-context-properties: fill;
appearance: none;
box-shadow: none;
padding: 1px 10px 1px 2px;
min-width: 3.8em;
}
.font-value-input + .font-value-select:dir(ltr) {
border-inline-start: none;
}
/* Swap around order of value input and unit dropdown for RTL */
.font-value-input + .font-value-select:dir(rtl) {
border-inline-end: none;
order: 2;
text-align: left;
}
.font-value-select:-moz-focusring {
color: transparent;
text-shadow: 0 0 0 var(--theme-text-color-strong);
}
.font-value-input:focus,
.font-value-select:focus {
outline: 1px solid var(--highlight-color);
outline-offset: -1px;
}
.font-value-slider-container {
flex: 1;
min-width: 50px;
position: relative;
margin-inline-end: 10px;
}
/* Firefox doesn't support pseudo-elements on inputs. Using the container instead. */
.font-value-slider-container::before,
.font-value-slider-container::after {
user-select: none;
color: var(--theme-text-color-alt);
font-size: smaller;
position: absolute;
bottom: -0.6em;
visibility: hidden;
}
.font-control-input:hover .font-value-slider-container::before,
.font-control-input:hover .font-value-slider-container::after,
.font-control-input:focus-within .font-value-slider-container::before,
.font-control-input:focus-within .font-value-slider-container::after {
visibility: visible;
}
.font-value-slider-container::before {
content: attr(data-min);
inset-inline-start: 0.3em;
}
.font-value-slider-container::after {
content: attr(data-max);
inset-inline-end: 0.3em;
}
.font-value-slider {
background: transparent;
width: 100%;
margin: 0;
}
/*
The value of font-weight goes from 100 to 900 in increments of 100.
Decorate the slider for font-weight to have 9 vertical notches using a linear gradient.
*/
.font-value-slider[name="font-weight"] {
--notch-size: 3px;
/* Draw a vertical line to get one notch per background-image instance */
background-image: linear-gradient(90deg, var(--slider-track-color) var(--notch-size), transparent 0);
/* Offset the background so the notch aligns with the center of the slider thumb */
background-position: 5px center;
/* Repeat the background-image horizontally */
background-repeat: repeat-x;
/* Size the background to get nine visible notch instances. */
background-size: calc(12.5% - var(--notch-size) / 2) 7px;
}
.font-value-slider:-moz-focusring {
outline: none;
}
.font-value-slider::-moz-range-thumb {
background-color: var(--slider-thumb-color);
border: 0;
}
.font-value-slider:focus::-moz-range-thumb {
background-color: var(--highlight-color);
}
.font-value-slider::-moz-range-track {
background-color: var(--slider-track-color);
height: 3px;
}
.font-origin {
margin-top: -0.25em;
color: var(--theme-comment);
justify-self: start;
}
.font-origin.system {
text-transform: capitalize;
}
.font-origin.remote {
display: grid;
grid-template-columns: 1fr 20px;
}
.font-origin.remote .url {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
direction: ltr;
}
.font-origin .copy-icon {
border: 0;
padding: 0;
position: relative;
cursor: pointer;
width: 12px;
height: 12px;
place-self: center;
background: url(chrome://devtools/skin/images/copy.svg) no-repeat;
background-size: 12px;
background-position-x: -1px;
-moz-context-properties: fill;
fill: var(--grey-50);
}
#font-container .accordion {
border-top: 1px solid var(--theme-splitter-color);
}
#font-container .accordion ._content {
padding: 0;
}
#font-container .accordion + .accordion {
border-top: none;
}
.font dl {
display: grid;
grid-template-columns: auto 1fr;
/* Make the gap the width of the twisty so we can place it in the gap */
column-gap: var(--devtools-twisty-size);
row-gap: 2px;
margin-block: 8px;
grid-column: 1 / -1;
dd {
margin-inline-start: 0;
word-break: initial;
/* Offset the expand button to place it inside the gap, so the text of truncated
strings still line up with the other values in the grid */
.theme-twisty {
margin-inline-start: calc(-1 * var(--devtools-twisty-size));
}
}
& a,
a:visited {
color: var(--theme-link-color);
}
}
|